Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy

# Deploys to FastAPI Cloud with a deploy token once CI has passed on main.
# Needs repo secrets FASTAPI_CLOUD_TOKEN (deploy token) and FASTAPI_CLOUD_APP_ID.
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
workflow_dispatch:

permissions: {}

concurrency:
group: fastapi-cloud-deploy
cancel-in-progress: false

jobs:
deploy:
name: deploy
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push')
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install FastAPI Cloud CLI
run: pip install fastapi-cloud-cli
- name: Deploy to FastAPI Cloud
run: fastapi deploy
env:
FASTAPI_CLOUD_TOKEN: ${{ secrets.FASTAPI_CLOUD_TOKEN }}
FASTAPI_CLOUD_APP_ID: ${{ secrets.FASTAPI_CLOUD_APP_ID }}
Loading