feat: separate between review & review-cleanup workflows

This commit is contained in:
JasterV 2026-01-19 00:26:18 +01:00
commit 961b24b202
2 changed files with 26 additions and 20 deletions

25
.github/workflows/review-cleanup.yml vendored Normal file
View file

@ -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

View file

@ -2,7 +2,7 @@ name: Deploy Review App
on: on:
# Run this workflow on every PR event. Existing review apps will be updated when the PR is updated. # Run this workflow on every PR event. Existing review apps will be updated when the PR is updated.
pull_request: pull_request:
types: [opened, reopened, synchronize, closed] types: [opened, reopened, synchronize]
env: env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
@ -12,12 +12,10 @@ env:
jobs: jobs:
ci: ci:
if: github.event.action != 'closed'
uses: ./.github/workflows/ci.yml uses: ./.github/workflows/ci.yml
secrets: inherit secrets: inherit
build_and_deploy: build_and_deploy:
if: github.event.action != 'closed'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: ci needs: ci
@ -72,20 +70,3 @@ jobs:
DATABASE_URL=${{ secrets.DATABASE_URL }} DATABASE_URL=${{ secrets.DATABASE_URL }}
SECRET_KEY_BASE=${{ secrets.SECRET_KEY_BASE }} SECRET_KEY_BASE=${{ secrets.SECRET_KEY_BASE }}
PHX_HOST=${{ env.APP_NAME }}.fly.dev 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