SuperUberDuper
SuperUberDuper

Reputation: 9633

Easiest way to create a demo in gh-pages (in keep insync with master)

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

Answers (1)

mgarciaisaia
mgarciaisaia

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 pushes 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

Related Questions