Merge pull request #1114 from OpenCircuits/eslint-cache-const-enum #367
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: Build and Deploy the nightly and documentation sites for the up-to-date code | |
env: | |
CLOUDSDK_CORE_PROJECT: opencircuits-nightly | |
concurrency: | |
group: deploy-night-workflow | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
setup-build-deploy: | |
name: Setup, Build, and Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: GCloud Auth | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: 'projects/995513074839/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | |
service_account: 'github-actions@opencircuits-nightly.iam.gserviceaccount.com' | |
- name: Setup GCloud | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Set Node.js 16.x | |
uses: actions/setup-node@main | |
with: | |
node-version: 16.x | |
- name: Install | |
run: yarn | |
# Build nightly site | |
- name: Build | |
env: | |
OC_OAUTH2_ID: ${{ secrets.OAUTH_ID }} | |
OC_AUTH_TYPES: google | |
OC_GA_ID: UA-201145837-1 | |
run: | | |
yarn build --ci --prod server digital | |
- name: Create OAuth credentials and app.yaml | |
run: | | |
echo "${{ secrets.OAUTH_CREDENTIALS }}" >> ./build/credentials.json | |
echo "${{ secrets.APP_YAML }}" >> ./build/app.yaml | |
- name: Deploy | |
working-directory: ./build | |
run: gcloud app deploy --quiet | |
# Build docs site | |
- name: Build Docs | |
run: | | |
yarn build:jsdocs | |
yarn build:docs | |
- name: Upload Docs to GCS | |
uses: google-github-actions/upload-cloud-storage@main | |
with: | |
path: src/site/pages/docs/build | |
destination: docs.opencircuits.io | |
parent: false |