Skip to content

Instantly share code, notes, and snippets.

@simon04
Last active April 7, 2019 20:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simon04/a2a5f68aee064b8e8ff41da70f150adf to your computer and use it in GitHub Desktop.
Save simon04/a2a5f68aee064b8e8ff41da70f150adf to your computer and use it in GitHub Desktop.
#!/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 git@github.com:${TRAVIS_REPO_SLUG}.git
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