Deploy DEV #2
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: Deploy DEV | |
on: [workflow_dispatch] | |
jobs: | |
deploy-backend: | |
runs-on: ubuntu-latest | |
environment: development | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js version | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: npm install | |
run: | | |
npm install | |
- name: Create env file | |
run: echo ${{ secrets.ASPA_DEV_BACKEND_ENVFILE }} | base64 --decode > .env | |
- name: Build app | |
run: | | |
npm run build | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.ASPA_DEV_GCP_DEPLOYMENT_SA_CREDENTIALS }}' | |
- id: 'app-engine-deploy' | |
uses: 'google-github-actions/deploy-appengine@v2' | |
with: | |
project_id: wdcc-aspa-dev | |
working_directory: ./ | |
deploy-frontend: | |
runs-on: ubuntu-latest | |
environment: DEV | |
defaults: | |
run: | |
working-directory: ./packages/frontend | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Create env file | |
run: echo ${{ secrets.ASPA_DEV_FRONTEND_ENVFILE }} | base64 --decode > .env | |
- run: yarn | |
- run: CI=false yarn build | |
- uses: 'google-github-actions/auth@v2' | |
with: | |
# Credentials stored inside WDCC organisation secrets | |
credentials_json: '${{ secrets.ASPA_DEV_GCP_DEPLOYMENT_SA_CREDENTIALS }}' | |
- uses: 'google-github-actions/upload-cloud-storage@v2' | |
with: | |
# Build path (path is excluded if parent: false flag) | |
path: 'packages/frontend/build' | |
parent: false | |
# Bucket to add contents into | |
destination: 'aspa-dev.wdcc.co.nz' |