Skip to content

chore(about): update names and add testers #85

chore(about): update names and add testers

chore(about): update names and add testers #85

name: Fly Deploy Staging
on:
push:
branches: [ master ]
jobs:
deploy-web:
name: Deploy Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: >
flyctl deploy --remote-only --config fly.staging.toml
--build-arg VITE_FIREBASE_PROJECT_ID=${{ secrets.VITE_FIREBASE_PROJECT_ID }}
--build-arg VITE_FIREBASE_API_KEY=${{ secrets.VITE_REACT_APP_API_KEY }}
--build-arg VITE_FIREBASE_AUTH_DOMAIN=${{ secrets.VITE_REACT_APP_AUTH_DOMAIN }}
--build-arg VITE_FIREBASE_STORAGE_BUCKET=${{ secrets.VITE_REACT_APP_STORAGE_BUCKET }}
--build-arg VITE_FIREBASE_APP_ID=${{ secrets.VITE_REACT_APP_APP_ID }}
--build-arg VITE_SERVER_URL=${{ secrets.VITE_REACT_APP_SERVER_URL_STAGING }}
working-directory: ./frontend
env:
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
deploy-api:
name: Deploy Api
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --config fly.staging.toml
working-directory: ./backend
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_STAGING_API_TOKEN }}
finalize-deployment:
name: Finalize Deployment
runs-on: ubuntu-latest
needs: [deploy-web, deploy-api]
if: always()
steps:
- name: Create Deployment via GitHub API
id: create
run: |
response=$(curl -s -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/deployments \
-d '{
"ref": "${{ github.sha }}",
"environment": "Fly Staging",
"required_contexts": [],
"auto_merge": false,
"description": "Deploying frontend and backend to Staging"
}')
echo "deployment_id=$(echo $response | jq -r '.id')" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Mark Deployment as Success
if: success()
run: |
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/deployments/${{ steps.create.outputs.deployment_id }}/statuses \
-d '{"state": "success"}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Mark Deployment as Failure
if: failure()
run: |
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/deployments/${{ steps.create.outputs.deployment_id }}/statuses \
-d '{"state": "failure"}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}