Openstatus
www.openstatus.dev
1name: Fly Preview Workflows
2on:
3 pull_request:
4 types: [opened, reopened, synchronize, closed]
5 paths:
6 - "apps/workflows/**"
7 - "packages/db/**"
8 - "packages/emails/**"
9 - "packages/utils/**"
10 - "packages/notifications/**"
11 - "packages/tsconfig/**"
12
13env:
14 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
15 # Set these to your Fly.io organization and preferred region.
16 FLY_REGION: ams
17 FLY_ORG: openstatus
18
19jobs:
20 review_app:
21 runs-on: depot-ubuntu-24.04-4
22 timeout-minutes: 15
23 outputs:
24 url: ${{ steps.deploy.outputs.url }}
25 # Only run one deployment at a time per PR.
26 concurrency:
27 group: pr-${{ github.event.number }}
28
29 # Deploying apps with this "review" environment allows the URL for the app to be displayed in the PR UI.
30 # Feel free to change the name of this environment.
31 environment:
32 name: pr-${{ github.event.number }} # The script in the `deploy` sets the URL output for each review app.
33 url: ${{ steps.deploy.outputs.url }}
34 steps:
35 - name: Get code
36 uses: actions/checkout@v4
37
38 - name: Deploy PR app to Fly.io
39 id: deploy
40 uses: superfly/fly-pr-review-apps@1.2.1
41 with:
42 config: apps/workflows/fly.toml
43 vmsize: shared-cpu-1x
44 name: openstatus-workflows-pr-${{ github.event.number }}
45 secrets: |
46 DATABASE_URL=${{ secrets.STAGING_DB_URL }}
47 DATABASE_AUTH_TOKEN=${{ env.STAGING_DB_AUTH_TOKEN }}
48 RESEND_API_KEY=${{ secrets.STAGING_RESEND_API_KEY }}
49 UPSTASH_REDIS_REST_URL=test
50 UPSTASH_REDIS_REST_TOKEN=test
51 GCP_PROJECT_ID=test
52
53 - name: Clean up GitHub environment
54 uses: strumwolf/delete-deployment-environment@v2
55 if: ${{ github.event.action == 'closed' }}
56 with:
57 # ⚠️ The provided token needs permission for admin write:org
58 token: ${{ secrets.GITHUB_TOKEN }}
59 environment: pr-${{ github.event.number }}