From 2d86ff0c664852dfb9de3e76bdae85388b5ed668 Mon Sep 17 00:00:00 2001 From: Thomas Fritz <287432+thomasfr@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:47:24 +0100 Subject: [PATCH] added destroy pr preview workflow (#3) --- .github/workflows/destroy-pr-preview.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/destroy-pr-preview.yaml diff --git a/.github/workflows/destroy-pr-preview.yaml b/.github/workflows/destroy-pr-preview.yaml new file mode 100644 index 0000000..9451857 --- /dev/null +++ b/.github/workflows/destroy-pr-preview.yaml @@ -0,0 +1,19 @@ +name: Destroy PR Preview + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +on: + pull_request: + types: [closed] + +jobs: + destroy-pr-preview: + name: "Destroying preview deployment for PR#${{ github.event.number }}" + runs-on: ubuntu-latest + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + steps: + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl apps destroy "f42-memory-game-pr-${{ github.event.number }}" --yes || true