From 7499e7f557cd022adf685521942971f6b6bd3b63 Mon Sep 17 00:00:00 2001 From: Tudor Date: Mon, 13 Jul 2026 08:35:39 +0100 Subject: [PATCH] ci: stop deploy pipeline at staging; production promotion becomes manual Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB --- .gitea/workflows/deploy.yml | 49 +++---------------------------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 03f5a35..31bb6ea 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy (staging -> E2E gate -> production) +name: Stage (build -> staging -> E2E gate) on: push: @@ -193,48 +193,5 @@ jobs: env: BASE_URL: ${{ secrets.STAGING_BASE_URL }} - promote-prod: - name: Promote to Production - runs-on: ubuntu-latest - needs: [e2e-staging] - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Gitea Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ gitea.actor }} - password: ${{ secrets.REGISTRY_TOKEN }} - - - name: Retag verified images as prod - run: | - SHORT_SHA="sha-$(echo "${{ gitea.sha }}" | cut -c1-7)" - for IMAGE in \ - "${REGISTRY}/${BACKEND_IMAGE_NAME}" \ - "${REGISTRY}/${FRONTEND_IMAGE_NAME}" \ - "${REGISTRY}/${PIPELINE_IMAGE_NAME}"; do - # Keep a rollback pointer before moving :prod - docker buildx imagetools create -t "${IMAGE}:prod-previous" "${IMAGE}:prod" || true - docker buildx imagetools create -t "${IMAGE}:prod" "${IMAGE}:${SHORT_SHA}" - echo "Promoted ${IMAGE}:${SHORT_SHA} -> :prod" - done - - - name: Trigger production stack update - run: curl -fsSk -X POST "${{ secrets.PORTAINER_PROD_WEBHOOK }}" - - - name: Wait for production to become healthy - run: | - echo "Polling ${PROD_BASE_URL} for up to 5 minutes..." - for i in $(seq 1 60); do - if curl -fsS -o /dev/null --max-time 10 "${PROD_BASE_URL}/"; then - echo "Production is up (attempt $i)" - exit 0 - fi - sleep 5 - done - echo "Production did not become healthy in time" >&2 - exit 1 - env: - PROD_BASE_URL: ${{ secrets.PROD_BASE_URL }} +# Production deployment is a second, manual approval: see promote.yml +# ("Promote to Production (manual)") and docs/DEPLOY.md.