Last active
December 5, 2023 06:03
-
-
Save jamesasu/a1c3e18638970563ceb8e925d56e91cf to your computer and use it in GitHub Desktop.
Build a clientside project and deploy to Google Cloud Storage
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
stages: | |
- build | |
- test | |
- deploy | |
variables: | |
NODE_ENV: production | |
build: | |
stage: build | |
image: node:21 | |
script: | |
- yarn install | |
- yarn run build | |
artifacts: | |
paths: | |
- dist | |
expire_in: 12 hrs | |
when: on_success | |
test: | |
stage: test | |
image: node:21 | |
needs: | |
- build | |
script: | |
- yarn run test | |
deploy: | |
stage: deploy | |
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:slim | |
needs: | |
- build | |
- test | |
rules: | |
- if: '$CI_COMMIT_BRANCH == "main"' | |
when: on_success | |
script: | |
- gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS | |
- gcloud storage cp dist/* gs://$GOOGLE_STORAGE_BUCKET/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment