fix: restaurar deploy-staging via workflow_run (Gitea ≥1.25)
All checks were successful
CI / static (push) Successful in 2m38s
CI / unit (push) Successful in 3m40s
CI / feature (push) Successful in 2m55s
CI / container (push) Successful in 1m11s
CI / browser (push) Successful in 4m22s

Remove job/reusable workflow do CI. Staging volta a ser workflow
separado após CI; 1.24 não implementava o trigger.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-12 16:01:56 -03:00
parent ac08b5f064
commit 26a68e1823
3 changed files with 24 additions and 23 deletions

View File

@@ -275,18 +275,3 @@ jobs:
docker logs "$HEALTH_NAME"
exit 1
# Staging deploy runs in-process after gates. workflow_run never fired on
# this Gitea 1.24 multi-job CI setup (0 deploy runs after green CI).
deploy-staging:
name: deploy-staging
needs: [static, unit, feature, browser, container]
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
uses: ./.gitea/workflows/deploy-staging.yml
secrets:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PAT: ${{ secrets.REGISTRY_PAT }}
DOKPLOY_URL: ${{ secrets.DOKPLOY_URL }}
DOKPLOY_API_KEY: ${{ secrets.DOKPLOY_API_KEY }}
DOKPLOY_STAGING_COMPOSE_ID: ${{ secrets.DOKPLOY_STAGING_COMPOSE_ID }}
STAGING_URL: ${{ secrets.STAGING_URL }}

View File

@@ -1,10 +1,15 @@
name: Deploy staging
# Invoked from ci.yml after all gates pass on main (workflow_call).
# workflow_run is unreliable on Gitea 1.24 with multi-job CI (never fired).
# workflow_dispatch keeps a manual re-deploy path.
# Requires Gitea >= 1.25 for workflow_run (1.24.x has no trigger match).
on:
workflow_call:
workflow_run:
workflows:
- CI
- ci.yml
types:
- completed
branches:
- main
workflow_dispatch:
permissions:
@@ -22,15 +27,22 @@ env:
jobs:
deploy:
name: publish-and-deploy-staging
if: >-
gitea.event_name == 'workflow_dispatch' ||
(gitea.event.workflow_run.conclusion == 'success' &&
gitea.event.workflow_run.event == 'push' &&
gitea.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout deployed SHA
uses: actions/checkout@v4
with:
ref: ${{ gitea.event.workflow_run.head_sha || gitea.sha }}
- name: Set image metadata
id: meta
run: |
SHA="${{ gitea.sha }}"
SHA="${{ gitea.event.workflow_run.head_sha || gitea.sha }}"
SHORT_SHA="${SHA:0:7}"
IMAGE="${REGISTRY}/${IMAGE_NAME}"
IMAGE="$(echo "$IMAGE" | tr '[:upper:]' '[:lower:]')"