From 46642eb487aec80d67a0de924ee67df1cd4740bc Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 26 Apr 2022 19:14:13 -0400 Subject: [PATCH] fix(ci): do not delete instances from `main` branch on merge (#4206) * fix(ci): do not delete instances from `main` branch on merge * fix(ci): do not delete instances on merge This was creating an unintended behavior, and so far instances are being cleaned up in its corresponding workflow. --- .github/workflows/clean.yml | 42 ------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/clean.yml diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml deleted file mode 100644 index 5a44ef73465..00000000000 --- a/.github/workflows/clean.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Clean - -on: - workflow_dispatch: - pull_request: - branches: - - main - types: [closed] - -env: - NETWORK: Mainnet - PROJECT_ID: zealous-zebra - REGION: us-central1 - ZONE: us-central1-a - -jobs: - delete: - name: Delete test deployments - runs-on: ubuntu-latest - permissions: - contents: 'read' - id-token: 'write' - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 - with: - short-length: 7 - - # Setup gcloud CLI - - name: Authenticate to Google Cloud - id: auth - uses: google-github-actions/auth@v0.7.1 - with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' - - - name: Delete test instance - continue-on-error: true - run: | - TEST_INSTANCES=$(gcloud compute instances list --filter="${{ env.GITHUB_REF_SLUG_URL }}" --format='value(NAME)') - for instance in ${TEST_INSTANCES}; do gcloud compute instances delete $instance --zone "${{ env.ZONE }}" --delete-disks all --quiet; done