-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (55 loc) · 1.92 KB
/
stash-rollup-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: stash-rollup-dev
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "stash-dev/**/*"
- ".github/**/rollup-dev**"
permissions:
contents: 'read'
id-token: 'write'
env:
COINGECKO_API_KEY: ${{ secrets.ORG_COINGECKO_API_KEY }}
jobs:
build:
name: Deploy to Google App Angine
runs-on: ubuntu-latest
defaults:
run:
working-directory: stash-dev
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: "./stash-dev/yarn.lock"
- run: yarn install --immutable
- run: yarn run build
- run: yarn run test-ci
- 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: google-github-actions/deploy-appengine@v2
id: deploy
with:
project_id: ${{ steps.auth.outputs.project_id }}
env_vars: |-
TIMESERIES_PASS=${{ secrets.TIMESERIES_PASS_ROLLUP_DEV }}
COINGECKO_API_KEY=${{ secrets.ORG_COINGECKO_API_KEY }}
working_directory: stash-dev
deliverables: app-rollup-dev.yaml
# 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