From 334b50747645c97f2da712764c2299ffc49745d2 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 10 May 2026 21:56:37 +0200 Subject: [PATCH] feat(ci): add release production deploy workflow Fires on `v*` tag push. Tags the built images with the git tag so rollbacks are a one-liner (TAG= docker compose ... up -d). `up -d --wait` blocks until every service healthcheck reports healthy; a bad release fails the workflow rather than crash-looping silently. The .env.production file containing all Gitea secrets is removed in `if: always()` after the deploy step. Refs #497. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/release.yml | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 00000000..dbf7a9a8 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,79 @@ +name: release + +# Builds and deploys the production environment on `v*` tag push. +# Runs on the self-hosted runner via Docker-out-of-Docker; images are +# tagged with the actual git tag (e.g. v1.0.0) so rollback is +# `TAG= docker compose -f docker-compose.prod.yml -p archiv-production up -d --wait` +# +# Production environment: +# - project name: archiv-production +# - host ports: backend 8080, frontend 3000 +# - profile: (none) — mailpit is excluded; real SMTP relay is used +# +# Required Gitea secrets: +# PROD_POSTGRES_PASSWORD +# PROD_MINIO_PASSWORD +# PROD_MINIO_APP_PASSWORD +# PROD_OCR_TRAINING_TOKEN +# PROD_APP_ADMIN_USERNAME (CRITICAL: see docs/DEPLOYMENT.md) +# PROD_APP_ADMIN_PASSWORD (CRITICAL: locked in on first deploy) +# MAIL_HOST +# MAIL_PORT +# MAIL_USERNAME +# MAIL_PASSWORD + +on: + push: + tags: + - "v*" + +env: + DOCKER_BUILDKIT: "1" + +jobs: + deploy-production: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Write production env file + run: | + cat > .env.production <