Run tests and deploy in one Gitea Actions job
Test and deploy / test-and-deploy (pull_request) Successful in 2m25s

Two jobs meant checking out, setting up Node and running npm ci (and in the
frontend the build) twice, about two minutes each, because every job starts
in a fresh container. Now one job tests and, for pushes to master only,
deploys. The push-to-master condition is spelled out on every deploy step
instead of an env flag compared to 'true', which would skip the deploy
silently and stay green if the boolean were rendered differently. A failed
test still stops the deploy (an if: without a status function implies
success()).

Docs: the one-job layout, and that Jenkins deployed as root - files it left
in an app folder must be chowned to the subscription user before the first
Gitea deploy (hit on the API).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PaddyandClaude Opus 5.5 committed 2026-11-08 22:51:26 +01:00
1 parent 689a485fce
commit b22e89001a
3 files changed
+34 -29

No files matched your search

+7 -5
View File
@@ -7,13 +7,15 @@ real deploy settles them - record the outcome here.
```
push to master ──▶ Gitea ──▶ runner (Docker container on the Plesk server)
├─ test job: npm ci, lint, tsc, test, build
└─ deploy job: build ─ rsync over SSH ─▶ plesk-nachklang@server:<app root>
└─ touch tmp/restart.txt
└─ one job: npm ci, lint, tsc, test, build
└─ (master only) rsync over SSH ─▶ plesk-nachklang@server:<app root>
└─ touch tmp/restart.txt
browser ──https──▶ Plesk (nginx + Passenger) ──▶ <app root>/server.js
```
Pull requests only run the test job.
Pull requests run the same job up to the build; the deploy steps only run for pushes to master.
It used to be two jobs (test, then deploy); since every job starts in a fresh container that meant
`npm ci` and the build twice (~2 min each), so they were merged on 2026-11-08.
## Why SSH and not mounted paths
@@ -155,7 +157,7 @@ to port 3000 if Passenger doesn't intercept.
4. **Back up the Angular build**: download `calendar.nachklang.art/` as a ZIP in Plesk's file
manager. The first deploy replaces those files, and this backup is the quick way back.
5. **Merge** `feature/nextjs-rewrite` into master and watch the run under *Actions*. When the
deploy job has finished, the folder holds the Next app but Plesk still serves it as static
deploy steps have finished, the folder holds the Next app but Plesk still serves it as static
files - **the subdomain is down from here until step 6** (no `index.html` any more).
6. **Step 5 above, right away** - switch the subdomain to the Node app. This is the moment the new
app goes live; doing it right after the run keeps the gap to a few minutes. (Plesk might accept