Skip to content

Instantly share code, notes, and snippets.

@delineas
Last active February 3, 2022 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delineas/70d261248e0086553c19a14e3fb8489c to your computer and use it in GitHub Desktop.
Save delineas/70d261248e0086553c19a14e3fb8489c to your computer and use it in GitHub Desktop.
Gatsby project CI/CD with deploy to other server
image: node:10.13-stretch
before_script:
- apt-get update -qq && apt-get install -y -qq sshpass
deploy_production:
stage: deploy
environment: Production
script:
- npm install
- npm rebuild
- npm install gatsby-cli
- node_modules/.bin/gatsby build --prefix-paths
- ls public
- sshpass -V
- export SSHPASS=$REMOTE_PASSWD
- sshpass -e scp -o stricthostkeychecking=no -r public/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH
artifacts:
paths:
- public
cache:
paths:
- node_modules
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment