This directory contains the GitHub Actions workflow that builds the Docker image and pushes it to GitHub Container Registry (GHCR) for deployment on Dokploy.
workflows/deploy.yml— On every pull request (→main/develop) and push tomain: run Flyway +./gradlew testagainst a PostgreSQL 15 service container (no external DB secrets). On push tomainonly, also build and push the image toghcr.io
El job verify levanta Postgres 15 Alpine en el runner (recicar_test / marketplace_test). No hace falta configurar secretos TEST_DATABASE_* en GitHub.
- Triggers on push to
main/ PRs tomainordevelop - verify: Postgres en servicio →
flywayMigrateTest→test - build (solo push a
main): Build the image using the repoDockerfile→ Push to GHCR with tagslatestandmain-<commit-sha> - Image name:
ghcr.io/<owner>/<repo>(GitHub path, lowercased for the registry)
- Repo Settings → Actions → General → Workflow permissions: Read and write permissions (so
GITHUB_TOKENcan push packages), or a PAT withwrite:packageswired into the workflow if you customize it - No Docker Hub account or secrets for the default workflow
- Source type: Docker
- Image:
ghcr.io/<your-lower-case-owner>/<your-lower-case-repo>:latest - For private packages, configure registry login on Dokploy (
ghcr.io+ GitHub username + PAT withread:packages)
Despliega un servicio PostgreSQL en el mismo proyecto/red que la app (plantilla de base de datos de Dokploy o stack Docker). Variables de la aplicación (perfil test):
SPRING_PROFILES_ACTIVE=testDATABASE_URL,DATABASE_USERNAME,DATABASE_PASSWORDapuntando al hostname interno del Postgres del stack test.
Detalle en ../DEPLOYMENT.md (sección entorno test).
- Quick checklist: DOKPLOY_SETUP.md
- Full guide: ../DEPLOYMENT.md
graph LR
A[Push to main] --> B[GitHub Actions]
B --> C[verify: PostgreSQL + tests]
C --> D[Push to GHCR]
D --> E[Deploy hook or manual]
E --> F[Dokploy pull & deploy]
F --> G[Health Check]
Edit workflows/deploy.yml:
on:
push:
branches: ["main", "production"]Add a step that POSTs to your Dokploy deploy URL (secret). See DEPLOYMENT.md.
In deploy.yml, extend platforms on the build-push step, for example:
platforms: linux/amd64,linux/arm64- Builds: GitHub → Actions
- Images: GitHub → Packages (
ghcr.io) - Runtime: Dokploy dashboard and logs
- 403 / denied push to ghcr.io: fix workflow permissions or use a PAT with
write:packagesindocker/login-action - Dokploy pull fails: check image name (lowercase), tag
latest, and private-registry credentials - Dockerfile errors: inspect the failed job log in Actions
- Do not commit registry or application secrets; use GitHub Secrets and Dokploy environment variables
- Rotate PATs used for private
docker pullfrom GHCR
Questions? See ../DEPLOYMENT.md