solution
zip9 files8 kBSolution of Lab 6: CI/CD
README.md
node-auth-app: CI/CD
Every push to main runs .github/workflows/cicd.yml (named CI/CD):
- test: starts db, backend and frontend with
docker compose up --build, then runs the Playwright tests againsthttp://localhost:5173. - build-and-push: only if the tests passed, builds both images for
linux/amd64andlinux/arm64and pushes them to the private Docker Hub repo<docker-id>/auth-app, tagsbackendandfrontend.
When the run ends green, a GitHub webhook (workflow_run events) reaches the deploy server on the local machine through ngrok. The server runs docker compose pull and up -d with docker-compose.deploy.yml.
Repository settings
| Where | Name | Value |
|---|---|---|
| Actions → Variables | DOCKERHUB_USERNAME |
Docker ID |
| Actions → Secrets | DOCKERHUB_TOKEN |
Docker Hub token, Read & Write |
| Webhooks | Payload URL | https://<ngrok-domain>/deploy, JSON, Workflow runs only |
Run locally
cp .env.example .env
docker compose up --build # app on http://localhost:5173
npm ci && npx playwright test # in another terminal