Skip to content

Instantly share code, notes, and snippets.

@jabyess
Created January 10, 2019 22:17
Show Gist options
  • Save jabyess/53d9dc33f6b742b7add2b52725d9650b to your computer and use it in GitHub Desktop.
Save jabyess/53d9dc33f6b742b7add2b52725d9650b to your computer and use it in GitHub Desktop.
Deploying parcel on gh-pages

Deploying static parcel projects on github pages

Build the project

Code your project as usual using parcel /path/to/index.pug

When you're finished, run parcel build --public-url <name-of-your-github-repo> -d docs /path/to/index.pug

For example, mine is parcel build --public-url /tower-of-hanoi -d docs pug/index.pug

This will put your output into a /docs folder.

git add and git commit all the newly generated files. This should be on the master branch

git push origin master to push to github

Configuring /docs

  • Go to your github's project settings
  • Scroll down to the github pages section
  • Under the source dropdown select master branch /docs folder

Then you're done!

Updating

Every time you want to update your project, you'll have to do that parcel build command and commit all the files in /docs again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment