Skip to content

Commit

Permalink
trigger destroy workflow via 'destroy' label
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywmoore committed Jun 28, 2024
1 parent 6f87191 commit 0754a93
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/dev_destroy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Create Dev Deployment
name: Destroy Dev Deployment

on:
pull_request:
types: [unlabeled]
types: [labeled]

env:
TERRAFORM_CLOUD_TOKENS: app.terraform.io=${{ secrets.TERRAFORM_API_TOKEN }}
Expand All @@ -12,7 +12,7 @@ env:

jobs:
deploy:
if: ${{ github.event.label.name == 'dev-deploy' }}
if: ${{ github.event.label.name == 'destroy' }}
runs-on: ubuntu-latest
steps:
- name: checkout terraform
Expand All @@ -28,3 +28,11 @@ jobs:
path: terraform/dev
workspace: dev-${{ github.head_ref }}

- name: remove labels
uses: actions-ecosystem/action-remove-labels@v1.3.0
with:
github_token: ${{ github.token }}
labels: |
deploy
destroy

0 comments on commit 0754a93

Please sign in to comment.