Analytics documentation update (#69) #64
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
name: CI/CD | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12' | |
- run: yarn install | |
- run: yarn build | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Cloud SDK | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12' | |
- run: yarn install | |
- run: yarn build | |
- name: Auth GCP | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
- name: Set up Cloud DOC | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: config project | |
run: gcloud config set project r2u-sdk | |
- name: Copy build to bucket | |
run: gsutil -m cp -r ./build/* gs://doc-r2u-bucket | |
- name: Set as index page | |
run: gsutil web set -m index.html gs://doc-r2u-bucket | |
- name: Invalidate cache | |
run: gcloud compute url-maps invalidate-cdn-cache doc-r2u-lb --async --path=/* |