Skip to content

Commit

Permalink
Merge branch 'master' into fix/loading-first-step
Browse files Browse the repository at this point in the history
  • Loading branch information
marluanespiritusanto authored May 9, 2024
2 parents 3047d31 + b47f3a0 commit 6679c96
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/delete-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Delete Cloud Run instances on PR closed by merged

on:
pull_request:
branches:
- master
types: [closed]

jobs:
delete-cloud-run:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/[email protected]

- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GAR_JSON_KEY }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'

- name: 'Use gcloud CLI'
run: 'gcloud info'

- name: Use gcloud CLI
run: gcloud run services delete ${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG }}-${{ env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }} --region=${{ vars.GCP_REGION }} --quiet

0 comments on commit 6679c96

Please sign in to comment.