Skip to content

Commit

Permalink
New: adding cloud run instances created by PR when is merged (#202)
Browse files Browse the repository at this point in the history
Co-authored-by: Genesis Alvarez <[email protected]>
  • Loading branch information
UsernameAlvarez and Genesis Alvarez authored May 9, 2024
1 parent 90d8872 commit b47f3a0
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 b47f3a0

Please sign in to comment.