diff --git a/.github/workflows/review-cleanup.yml b/.github/workflows/review-cleanup.yml new file mode 100644 index 0000000..5eb3d24 --- /dev/null +++ b/.github/workflows/review-cleanup.yml @@ -0,0 +1,25 @@ +name: Cleanup Review App +on: + pull_request: + types: [closed] + +env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + APP_NAME: pr-${{ github.event.pull_request.number }}-jasterv-spazio-solazzo + +jobs: + review_app_cleanup: + runs-on: ubuntu-latest + + concurrency: + group: pr-${{ github.event.number }} + + environment: + name: review + + steps: + - name: Destroy PR app + uses: superfly/fly-pr-review-apps@1.5.0 + with: + name: ${{ env.APP_NAME }} + config: fly.review.toml diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index fa66a26..ad7b1c2 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -2,7 +2,7 @@ name: Deploy Review App on: # Run this workflow on every PR event. Existing review apps will be updated when the PR is updated. pull_request: - types: [opened, reopened, synchronize, closed] + types: [opened, reopened, synchronize] env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} @@ -12,12 +12,10 @@ env: jobs: ci: - if: github.event.action != 'closed' uses: ./.github/workflows/ci.yml secrets: inherit build_and_deploy: - if: github.event.action != 'closed' runs-on: ubuntu-latest needs: ci @@ -72,20 +70,3 @@ jobs: DATABASE_URL=${{ secrets.DATABASE_URL }} SECRET_KEY_BASE=${{ secrets.SECRET_KEY_BASE }} PHX_HOST=${{ env.APP_NAME }}.fly.dev - - review_app_cleanup: - if: github.event.action == 'closed' - runs-on: ubuntu-latest - - concurrency: - group: pr-${{ github.event.number }} - - environment: - name: review - - steps: - - name: Destroy PR app - uses: superfly/fly-pr-review-apps@1.5.0 - with: - name: ${{ env.APP_NAME }} - config: fly.review.toml