-
Notifications
You must be signed in to change notification settings - Fork 71
38 lines (38 loc) · 1.48 KB
/
quick_deploy.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
# Workflow to push the change to deploy the change to players
# on push to master much quicker without waiting for cron jobs.
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
if: github.repository == 'beyond-all-reason/BYAR-Chobby'
permissions:
id-token: write
steps:
- name: Trigger rebuild
run: |
echo "$SSH_KEY" > id.key
chmod og-rwx id.key
ssh -i id.key -o StrictHostKeyChecking=no [email protected] byar-chobby
env:
SSH_KEY: ${{ secrets.SSH_REPOS_DEPLOY_KEY }}
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/640511349987/locations/global/workloadIdentityPools/github-actions/providers/github
service_account: [email protected]
token_format: id_token
id_token_audience: cdnupdater
id_token_include_email: true
- name: Sync files to CDN
run: |
curl --fail -H "Authorization: Bearer ${{ steps.auth.outputs.id_token }}" \
-X POST -d '["byar-chobby"]' https://rapidsyncer-ssd-7xiouooxaa-ey.a.run.app/sync
- name: Update CDN pointer
run: |
curl --fail -H "Authorization: Bearer ${{ steps.auth.outputs.id_token }}" \
-X GET https://bunny-update-edge-rule-7xiouooxaa-ew.a.run.app/update-edge-rule.sh