Created
November 13, 2019 16:03
-
-
Save johnshumon/616ffdea88da2e716e36187d887b0ea0 to your computer and use it in GitHub Desktop.
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: google/cloud-sdk:alpine | |
deploy_in_appengine: | |
stage: deploy | |
environment: | |
name: production | |
only: | |
- develop | |
script: | |
- echo $SERVICE_ACCOUNT > /tmp/$SERVICE_ACCOUNT_KEY.json | |
- gcloud auth activate-service-account --key-file /tmp/$SERVICE_ACCOUNT_KEY.json | |
# update and install yarn | |
- apk update && apk add yarn nodejs npm | |
# workaround for Error: could not get uid/gid | |
- npm config set unsafe-perm true | |
# populate app.yaml file from app.template.yaml and env variables defined in gitlab CI/CD | |
- npx gae-ayaml-env | |
# install dependencies from package.json | |
- yarn install | |
# build a production build | |
- NODE_ENV=production yarn build | |
# deploy in app engine | |
- gcloud --quiet --project=$PROJECT_ID app deploy app.yaml | |
after_script: | |
- rm -f /tmp/$SERVICE_ACCOUNT_KEY.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment