-
Notifications
You must be signed in to change notification settings - Fork 21
69 lines (65 loc) · 2.07 KB
/
deploy-app-engine.yaml
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
65
66
67
68
69
name: Deploy to GCP App Engine
on: [push, pull_request_target]
concurrency:
group: "ae"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [latest]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build
run: npm test
- name: Generate deployment package
run: zip -r deploy.zip . -x '*.git'
- name: Upload deployment package artifact
uses: actions/upload-artifact@v3
with:
name: app-engine
path: deploy.zip
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: build
environment:
name: gcp-app-engine
url: https://descent.live
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
project_id: ${{ vars.GCP_PROJECT_ID }}
- name: Download deployment package artifact
uses: actions/[email protected]
with:
name: app-engine
- name: Unzip deployment package
run: unzip deploy.zip
- name: Cleanup build files
run: rm -rf deploy.zip .git
- name: Deploy to GCP App Engine
uses: google-github-actions/deploy-appengine@v1
with:
version: main
env_vars: |-
HUE_CLIENT=${{ vars.HUE_CLIENT }}
HUE_ID=${{ vars.HUE_ID }}
HUE_SECRET=${{ secrets.HUE_SECRET }}
LASTFM_POLL_INTERVAL=${{ vars.LASTFM_POLL_INTERVAL }}
OPENWEATHERMAP_KEY=${{ secrets.OPENWEATHERMAP_KEY }}
SPOTIFY_CLIENT=${{ vars.SPOTIFY_CLIENT }}
SPOTIFY_SECRET=${{ secrets.SPOTIFY_SECRET }}