diff --git a/.github/workflows/quick_deploy.yml b/.github/workflows/quick_deploy.yml new file mode 100644 index 000000000..8902aee2d --- /dev/null +++ b/.github/workflows/quick_deploy.yml @@ -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 debian@repos.beyondallreason.dev 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: github-actions@bar-rapid-syncer-176212.iam.gserviceaccount.com + 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