Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
2.3 kB ยท 80 lines
YAML
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081name: Fly Preview API serveron: workflow_dispatch: inputs: action: description: "Action to perform" required: true type: choice options: - deploy - destroy
permissions: contents: read deployments: write
env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} FLY_REGION: ams FLY_ORG: openstatus APP_NAME: openstatus-api-preview-${{ github.ref_name }}
jobs: deploy: if: ${{ github.event.inputs.action == 'deploy' }} runs-on: depot-ubuntu-24.04-4 timeout-minutes: 15 concurrency: group: api-preview-${{ github.ref_name }} environment: name: api-preview-${{ github.ref_name }} url: https://${{ env.APP_NAME }}.fly.dev steps: - name: Get code uses: actions/checkout@v6
- name: Setup Fly.io CLI uses: superfly/flyctl-actions/setup-flyctl@master
- name: Create app if not exists run: flyctl apps create ${{ env.APP_NAME }} --org ${{ env.FLY_ORG }} || true
- name: Set secrets run: | flyctl secrets set \ DATABASE_URL="${{ secrets.STAGING_DB_URL }}" \ DATABASE_AUTH_TOKEN="${{ secrets.STAGING_DB_AUTH_TOKEN }}" \ RESEND_API_KEY="${{ secrets.STAGING_RESEND_API_KEY }}" \ UPSTASH_REDIS_REST_URL=test \ UPSTASH_REDIS_REST_TOKEN=test \ GCP_PROJECT_ID=test \ NEXT_PUBLIC_OPENPANEL_CLIENT_ID=test \ OPENPANEL_CLIENT_SECRET=test \ --app ${{ env.APP_NAME }}
- name: Deploy to Fly.io run: | flyctl deploy \ --config apps/server/fly.toml \ --app ${{ env.APP_NAME }} \ --region ${{ env.FLY_REGION }} \ --vm-size shared-cpu-1x \ --yes
destroy: if: ${{ github.event.inputs.action == 'destroy' }} runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Setup Fly.io CLI uses: superfly/flyctl-actions/setup-flyctl@master
- name: Destroy app run: flyctl apps destroy ${{ env.APP_NAME }} --yes || true
- name: Clean up GitHub environment uses: strumwolf/delete-deployment-environment@v2 with: token: ${{ secrets.GITHUB_TOKEN }} environment: api-preview-${{ github.ref_name }}