Reputation: 9633
I have a repo where I have the following structure
index.html
src/
dist/
I have only index
and src/
inside git (dist/ is ignored) but I want to create a gh-pages that only has index
and /dist
.
What is the best way to keep them both in sync? Atm I have to do this manually.
Upvotes: 0
Views: 46
Reputation: 15620
Continuous integration.
Use some GitHub integration like Circle CI or Travis CI that gets notified of every push in your master
branch and builds and deploys to your gh-pages
branch.
You can read any of this posts to get some ideas of how to configure all this.
If you want all of this to happen in a local repository, and only push the gh-pages
branch to GitHub, you can try to run some post-commit
hook that builds the site on to dist/
and push
es it to GitHub.
It's a bit more awkward, since you probably don't want to push every commit you do, but it's doable. Also, this should be a bit slow, so you probably want to do the build as a background job.
Upvotes: 1