Skip to content

chore: update stash service code directory and configure deployment… #17

chore: update stash service code directory and configure deployment…

chore: update stash service code directory and configure deployment… #17

name: stash-rollup-testnet
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "stash/**/*"
- ".github/**/rollup-testnet**"
permissions:
contents: 'read'
id-token: 'write'
env:
ENVIRONMENT: rollup-testnet
jobs:
build:
name: Deploy to Google App Angine
runs-on: ubuntu-latest
defaults:
run:
working-directory: stash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: "./stash/yarn.lock"
- uses: google-github-actions/auth@v2
id: auth
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- uses: google-github-actions/setup-gcloud@v2
- uses: mdgreenwald/[email protected]
- run: yarn install --immutable
- run: yarn run build
- run: sops exec-env ${{ env.ENVIRONMENT }}.enc.env 'yarn run test-ci'
- name: Deploy to Google App Engine
working-directory: stash
run: sops exec-env ${{ env.ENVIRONMENT }}.enc.env 'gcloud app deploy app-${{ env.ENVIRONMENT }}.yaml --quiet'
# TODO: temporary disable smoke test
# - name: smoke test
# run: |
# curl "${{ steps.deploy.outputs.url }}"
# echo "Deployed to ${{ steps.deploy.outputs.url }}"
# - name: Delete old versions
# # This command deletes all versions except the last 14
# # Ref: https://stackoverflow.com/a/66911696/9645556
# run: gcloud app versions list --service=mangata-stash-rollup-dev --format="value(version.id)" --sort-by="~version.createTime" | tail -n +15 | xargs -r gcloud app versions delete --quiet