Skip to content

updated app.yaml

updated app.yaml #718

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build-and-deploy:
permissions:
contents: 'read'
id-token: 'write'
deployments: 'write'
strategy:
matrix:
node-version:
- '16.x'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- name: Build
run: npm run build
- run: cp -r ./dist/dev appengine/frontend/static/
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / - | tr _ -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / - | tr _ -)" >> $GITHUB_ENV
- run: echo ${{ env.BRANCH_NAME }}
- name: start deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ env.BRANCH_NAME }}
desc: Setting up staging deployment for ${{ env.BRANCH_NAME }}
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github'
service_account: '[email protected]'
- id: deploy
uses: google-github-actions/deploy-appengine@main
with:
version: ${{ env.BRANCH_NAME }}
deliverables: appengine/frontend/app.yaml
promote: false
- name: update deployment status
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ steps.deployment.outputs.env }}
env_url: ${{ steps.deploy.outputs.url }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}