chore: update workflows

This commit is contained in:
JasterV 2026-01-14 12:46:48 +01:00
parent daee758308
commit b633ec119b
4 changed files with 61 additions and 30 deletions

View file

@ -1,10 +1,8 @@
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch: {}
workflow_call:
permissions:
contents: read

View file

@ -1,18 +0,0 @@
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

45
.github/workflows/production.yml vendored Normal file
View file

@ -0,0 +1,45 @@
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
name: Production CI
on:
push:
branches:
- main
jobs:
ci:
uses: ./.github/workflows/ci.yml
secrets: inherit
deploy:
name: Deploy app
needs: ci
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
environment:
name: production
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Set Fly secrets
run: |
flyctl secrets set \
TOKEN_SIGNING_SECRET="$TOKEN_SIGNING_SECRET" \
ADMIN_EMAIL="$ADMIN_EMAIL" \
SPAZIO_SOLAZZO_EMAIL="$SPAZIO_SOLAZZO_EMAIL" \
FRONT_OFFICE_PHONE_NUMBER="$FRONT_OFFICE_PHONE_NUMBER" \
RESEND_API_KEY="$RESEND_API_KEY" \
DATABASE_URL="$DATABASE_URL"
env:
TOKEN_SIGNING_SECRET: ${{ secrets.TOKEN_SIGNING_SECRET }}
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
SPAZIO_SOLAZZO_EMAIL: ${{ secrets.SPAZIO_SOLAZZO_EMAIL }}
FRONT_OFFICE_PHONE_NUMBER: ${{ secrets.FRONT_OFFICE_PHONE_NUMBER }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

View file

@ -11,8 +11,13 @@ env:
APP_NAME: pr-${{ github.event.pull_request.number }}-jasterv-spazio-solazzo
jobs:
ci:
uses: ./.github/workflows/ci.yml
secrets: inherit
review_app:
runs-on: ubuntu-latest
needs: ci
outputs:
url: ${{ steps.deploy.outputs.url }}
# Only run one deployment at a time per PR.
@ -50,11 +55,12 @@ jobs:
with:
name: ${{ env.APP_NAME }}
config: fly.review.toml
env:
TOKEN_SIGNING_SECRET: ${{ secrets.TOKEN_SIGNING_SECRET }}
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
SPAZIO_SOLAZZO_EMAIL: ${{ secrets.SPAZIO_SOLAZZO_EMAIL }}
FRONT_OFFICE_PHONE_NUMBER: ${{ secrets.FRONT_OFFICE_PHONE_NUMBER }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
secrets: |
TOKEN_SIGNING_SECRET=${{ secrets.TOKEN_SIGNING_SECRET }}
ADMIN_EMAIL=${{ secrets.ADMIN_EMAIL }}
SPAZIO_SOLAZZO_EMAIL=${{ secrets.SPAZIO_SOLAZZO_EMAIL }}
FRONT_OFFICE_PHONE_NUMBER=${{ secrets.FRONT_OFFICE_PHONE_NUMBER }}
RESEND_API_KEY=${{ secrets.RESEND_API_KEY }}
DATABASE_URL=${{ secrets.DATABASE_URL }}
SECRET_KEY_BASE=${{ secrets.SECRET_KEY_BASE }}
PHX_HOST=${{ env.APP_NAME }}.fly.dev