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