Merge pull request #767 from AntlerForce/master #276
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |