Skip to content

refactor(client): modernize React state synchronization (#57) #33

refactor(client): modernize React state synchronization (#57)

refactor(client): modernize React state synchronization (#57) #33

name: Deploy Production
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
deployments: write
concurrency:
group: fly-deploy-production-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
name: Fly.io
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Create GitHub Deployment
id: deployment
env:
GH_TOKEN: ${{ github.token }}
run: |
TARGET_SHA="${{ github.sha }}"
LOG_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
DEPLOY_ID=$(gh api repos/${{ github.repository }}/deployments --input - --jq '.id' <<EOF
{
"ref": "$TARGET_SHA",
"environment": "production",
"description": "Deploying commit ${TARGET_SHA:0:7} to production",
"auto_merge": false,
"required_contexts": []
}
EOF
)
echo "deployment_id=$DEPLOY_ID" >> "$GITHUB_OUTPUT"
gh api repos/${{ github.repository }}/deployments/$DEPLOY_ID/statuses \
-f state="in_progress" \
-f log_url="$LOG_URL" \
-f description="Deployment in progress via ${{ github.workflow }} #${{ github.run_number }}" \
-f environment_url="https://illinispots.com"
- name: Set up Flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
with:
version: "latest"
- name: Deploy to Production
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: |
flyctl deploy \
--config fly.toml \
--build-arg SENTRY_AUTH_TOKEN="${{ secrets.SENTRY_AUTH_TOKEN }}"
- name: Update Deployment Status
if: always() && steps.deployment.outputs.deployment_id != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
STATUS="${{ job.status == 'success' && 'success' || 'failure' }}"
LOG_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
gh api repos/${{ github.repository }}/deployments/${{ steps.deployment.outputs.deployment_id }}/statuses \
-f state="$STATUS" \
-f log_url="$LOG_URL" \
-f description="Deployed via ${{ github.workflow }} #${{ github.run_number }}" \
-f environment_url="https://illinispots.com" \
-f auto_inactive=true