- Create a deploy user
- Give them repository permissions
- Create a Personal Access Token for the deploy user (Settings -> Personal Access Token) with
repo
permissions - Store that as an environmental variable in travis
- (The motivation for creating a separate deploy user is to avoid creating a personal access token for your personal github account which would have access to all of your repos.)
- Create a gh-pages branch on the main repository
Last active
August 11, 2017 13:36
-
-
Save spiderbites/acffe9ba1b0c44d34b2375b5cd837f0d to your computer and use it in GitHub Desktop.
[Setting up github pages deploys from Travis] #travis #gh-pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "6" | |
cache: | |
yarn: true # I happen to be using yarn | |
directories: | |
- node_modules | |
notifications: | |
email: false | |
before_deploy: | |
- <BUILD_COMMAND_HERE> | |
deploy: | |
provider: pages | |
skip_cleanup: true | |
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard | |
local_dir: <LOCAL_DIR_CONTAINING_STATIC_FILES> | |
on: | |
branch: master | |
branches: | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment