feat: centralize branding #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🧹 Preview Cleanup | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| destroy: | |
| name: 🗑 Remove Preview App | |
| runs-on: ubuntu-24.04 | |
| if: ${{ github.event.pull_request.head.repo.fork == false }} | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| steps: | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: 🔤 Read Fly app name | |
| id: base_app | |
| uses: SebRollen/[email protected] | |
| with: | |
| file: fly.toml | |
| field: app | |
| - name: 🎈 Setup Fly | |
| uses: superfly/flyctl-actions/[email protected] | |
| - name: 🗑 Destroy preview app | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| preview_app_name="${{ steps.base_app.outputs.value }}-pr-${{ github.event.pull_request.number }}" | |
| flyctl apps destroy "${preview_app_name}" --yes || echo "App already removed" | |
| env: | |
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
| - name: 💬 Notify pull request | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| ♻️ Preview environment `${{ steps.base_app.outputs.value }}-pr-${{ github.event.pull_request.number }}` has been destroyed. |