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` # # Operational assumptions (see docs/DEPLOYMENT.md §3 for the full setup): # # 1. Single-tenant self-hosted runner. The "Write production env file" # step writes every secret to .env.production on the runner # filesystem; the `if: always()` cleanup step removes it. A # multi-tenant runner would need to switch to # `docker compose --env-file <(stdin)` instead. # # 2. Host docker layer cache is authoritative. There is no # actions/cache; we rely on the host daemon to keep Maven and npm # layers warm between runs. A `docker system prune` on the host # will cause the next release build to be cold (5–10 min slower). # # 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: # See nightly.yml — same rationale: `ubuntu-latest` matches the # advertised label of our single-tenant self-hosted runner. runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Write production env file run: | cat > .env.production <