feat: update build workflow to create and publish all-in-one Docker image on approved PRs
Some checks failed
CI / Frontend Tests (pull_request) Has been cancelled
CI / Backend Tests (pull_request) Has been cancelled

This commit is contained in:
2026-03-27 16:18:25 -03:00
parent 6305a8e95e
commit d6de131a9b
4 changed files with 29 additions and 13 deletions

View File

@@ -83,8 +83,8 @@ The cycle for every step is:
| Reverse Proxy | Nginx (serves frontend + proxies `/api` to backend) |
| Dev Mail | Mailhog (SMTP trap + web UI) |
| All-in-one image | Single Docker image: Nginx + Spring Boot + PostgreSQL + Supervisor |
| Image registry | Local Docker image on the deployment host (`condado-newsletter`) |
| CI/CD | Gitea Actions — test PRs to `develop`, deploy approved PRs targeting `main` |
| Image registry | Gitea container registry (`gitea.lab/sancho41/condado-newsletter`) |
| CI/CD | Gitea Actions — test PRs to `develop`, build and publish the production image on approved PRs targeting `main` |
## Deployment Flavours
@@ -104,7 +104,7 @@ The all-in-one image (`Dockerfile.allinone`) bundles **everything** into a singl
- **PostgreSQL** — embedded database
- **Supervisor** — process manager that starts and supervises all three processes
The all-in-one image is built locally or in external pipelines as needed (no default registry publish workflow in-repo).
The all-in-one image is built on the runner host and then published to the Gitea container registry.
**Minimal `docker run` command:**
```bash
@@ -121,7 +121,7 @@ docker run -d \
-e IMAP_PORT=993 \
-e APP_RECIPIENTS=friend1@example.com,friend2@example.com \
-v condado-data:/var/lib/postgresql/data \
<registry-or-local-image>/condado-newsletter:latest
gitea.lab/sancho41/condado-newsletter:latest
```
The app is then available at `http://localhost`.
@@ -575,9 +575,9 @@ Good examples:
| Workflow file | Trigger | What it does |
|----------------------------|----------------------------|-----------------------------------------------------------|
| `.gitea/workflows/ci.yml` | PR to `develop` | Backend tests (`./gradlew test`) + Frontend tests (`npm run test`) |
| `.gitea/workflows/build.yml` | Approved PR review on `main` | Build `condado-newsletter` locally on the runner host |
| `.gitea/workflows/build.yml` | Approved PR review on `main` | Build `condado-newsletter`, then publish `latest` and `${github.sha}` tags to Gitea container registry |
Build policy: the runner shares the target Docker host, so the build workflow produces the local `condado-newsletter` image directly on that host. `docker-compose.prod.yml` is image-based and can be started separately without build directives.
Build policy: the runner shares the target Docker host, so the build workflow produces the image locally, tags it for `gitea.lab/sancho41/condado-newsletter`, and pushes it to Gitea container registry. `docker-compose.prod.yml` references that published image.
---