-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Publishing to GitHub Pages
You can publish the GUI to github.io so that others on the Internet can view it.
To manually publish from a local build, first ensure your gh-pages
branch is set
up to track the fork you intend to publish to.
# Build for github.io
npm run build
# Commit and push the build result to your gh-pages branch
npm run deploy
This should have made and pushed a commit to the gh-pages
branch, which should now be visible
at https://<your username>.github.io/scratch-gui/
You can also use Travis CI to automatically publish build results to github.io whenever you push to your fork.
Note: You will need to ensure your branch has no lint errors for the build to be published automatically
-
Generate a Personal Access Token for Travis in GitHub
- Go to your account settings
- Go to Personal Access Tokens under "Developer settings"
- Click "Generate new token"
- Give it a memorable description like "Deploy scratch-gui to Github Pages"
- Check off
public_repo
permissions only - Generate it and copy the token
- Important: This token represents your GitHub username AND password! Keep it secure!
-
Go to https://travis-ci.org and sign in with your Github account
-
Enable and configure your fork in Travis
- Click on your username in the top right
- Find your fork of scratch-gui and enable it
- Click the gear next to the name of your fork in your account settings
- Available at the URL
https://travis-ci.org/<your username>/scratch-gui/settings
- Also available from the dropdown "More options" -> "Settings"
- Available at the URL
- In the Environment Variables section, add two variables
-
GH_TOKEN
- Value:
<Your personal access token generated above>
- Leave "Display value in build log" OFF
- Value:
-
RELEASE_BRANCHES
- Value:
"master develop <any other branch name you would like to build>"
- You can turn on "Display value in build log" for debugging purposes
- Value:
-
-
Push to one of the branches you specified in the
RELEASE_BRANCHES
variable -
After Travis runs the build, it should deploy to your gh-pages
-
Visit
https://<your username>.github.io/scratch-gui/
to see the build