Last active
February 3, 2022 08:19
-
-
Save delineas/70d261248e0086553c19a14e3fb8489c to your computer and use it in GitHub Desktop.
Gatsby project CI/CD with deploy to other server
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
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