Last active
June 2, 2019 06:45
-
-
Save dinukasal/54ad8607a308c46e9e83204389f07e49 to your computer and use it in GitHub Desktop.
gitlab ci for building and pushing react app to google cloud(gcloud) 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
image: nikolaik/python-nodejs:latest | |
before_script: | |
# Install CA certs, openssl to https downloads, python for gcloud sdk | |
- apt install -y make ca-certificates openssl python | |
- update-ca-certificates | |
# Download and install Google Cloud SDK | |
- wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz | |
- tar zxvf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --usage-reporting=false --path-update=true | |
- google-cloud-sdk/bin/gcloud --quiet components update | |
- google-cloud-sdk/bin/gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_KEY | |
- google-cloud-sdk/bin/gcloud config set project lift-srilanka | |
- npm i -g yarn | |
- yarn | |
stages: | |
- publish | |
cache: | |
paths: | |
- node_modules/ | |
publish: | |
stage: publish | |
script: | |
- CI=false yarn build | |
- google-cloud-sdk/bin/gcloud app deploy | |
only: | |
- tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
seems this is better,