Last active
April 7, 2019 20:17
-
-
Save simon04/a2a5f68aee064b8e8ff41da70f150adf to your computer and use it in GitHub Desktop.
Deploy to GitHub Pages using Travis CI and deploy keys – https://medium.com/@simon.legner/deploy-to-github-pages-using-travis-ci-and-deploy-keys-db84fed7a929
This file contains hidden or 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
#!/bin/sh | |
set -e | |
# setup ssh-agent and provide the GitHub deploy key | |
eval "$(ssh-agent -s)" | |
openssl aes-256-cbc -K $encrypted_dc4c0df7bb33_key -iv $encrypted_dc4c0df7bb33_iv -in id_ed25519.enc -out id_ed25519 -d | |
chmod 600 id_ed25519 | |
ssh-add id_ed25519 | |
# commit the assets in build/ to the gh-pages branch and push to GitHub using SSH | |
./node_modules/.bin/gh-pages -d build/ -b gh-pages -r [email protected]:${TRAVIS_REPO_SLUG}.git |
This file contains hidden or 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: | |
- node | |
script: | |
# test/lint and build the project | |
- npm run lint | |
- npm run build | |
deploy: | |
- provider: script | |
skip_cleanup: true # do not delete the built assets | |
script: ./.travis-deploy.sh | |
on: | |
branch: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment