Openstatus www.openstatus.dev

🔥 pr preview fly (#1467)

authored by

Thibault Le Ouay and committed by
GitHub
65275ea0 6fd6233c

+61
+59
.github/workflows/api-preview.yml
··· 1 + name: Fly Preview API server 2 + on: 3 + pull_request: 4 + types: [opened, reopened, synchronize, closed] 5 + paths: 6 + - "apps/server/**" 7 + - "packages/db/**" 8 + - "packages/emails/**" 9 + - "packages/regions/**" 10 + - "packages/tsconfig/**" 11 + - "packages/utils/**" 12 + - "packages/upstash/**" 13 + 14 + env: 15 + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} 16 + # Set these to your Fly.io organization and preferred region. 17 + FLY_REGION: ams 18 + FLY_ORG: openstatus 19 + 20 + jobs: 21 + review_app: 22 + runs-on: ubuntu-latest 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/server/fly.toml 43 + vmsize: shared-cpu-1x 44 + name: openstatus-api-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 }}
+2
.github/workflows/workflow-preview.yml
··· 7 7 - "packages/db/**" 8 8 - "packages/emails/**" 9 9 - "packages/utils/**" 10 + - "packages/notifications/**" 10 11 - "packages/tsconfig/**" 12 + 11 13 env: 12 14 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} 13 15 # Set these to your Fly.io organization and preferred region.