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 335beb3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 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 @@ -27,4 +27,15 @@ jobs:
with:
path: terraform/dev
workspace: dev-${{ github.head_ref }}
variables: |
tag = "latest"
name = "hushline-${{ 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 335beb3

Please sign in to comment.