-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub workflow to push changes to players quicker
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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 | ||
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 |