From 6f692a8f28c732405487becc7f4f92079b711542 Mon Sep 17 00:00:00 2001 From: mtauha Date: Thu, 1 Oct 2026 16:12:05 +0500 Subject: [PATCH] ci: deploy to FastAPI Cloud on published releases instead of every push to main --- .github/workflows/deploy.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 720e2f4..2e93d6d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,12 +1,11 @@ name: Deploy +run-name: "Deploy ${{ github.ref_name }} to FastAPI Cloud" -# Deploys to FastAPI Cloud with a deploy token once CI has passed on main. +# Deploys to FastAPI Cloud with a deploy token when a GitHub release is published. # Needs repo secrets FASTAPI_CLOUD_TOKEN (deploy token) and FASTAPI_CLOUD_APP_ID. on: - workflow_run: - workflows: [CI] - types: [completed] - branches: [main] + release: + types: [published] workflow_dispatch: permissions: {} @@ -18,14 +17,12 @@ concurrency: jobs: deploy: name: deploy - if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push') + if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease 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"