CI: Gitea-Action baut und deployt bei Push auf main (Runner-Whitelist, dist-Laufzeitmount)
Build & Deploy / deploy (push) Successful in 23s

This commit is contained in:
Kimi Work
2026-10-10 16:38:08 +02:00
parent 6ac0282851
commit ad6230c335
3 changed files with 50 additions and 2 deletions
+40
View File
@@ -0,0 +1,40 @@
name: Build & Deploy
# Fährt automatisch bei jedem Push auf main aus:
# Abhängigkeiten → Build → dist/ auf den VPS kopieren → Health-Check.
# Das dist/-Verzeichnis ist auf dem Web-Container als Laufzeit-Mount
# eingebunden (/opt/1bis8/web/dist), nginx pickt neue Dateien sofort auf.
on:
push:
branches: [main]
jobs:
deploy:
runs-on: docker
container:
image: node:22-alpine
# /opt/1bis8 des Hosts steht im Job als /deploy bereit (Whitelist im Runner)
options: -v /opt/1bis8:/deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Abhängigkeiten installieren
run: cd app && npm ci
- name: Build
run: cd app && npm run build
- name: Deploy auf 1bis.hocks.eu
run: |
rm -rf /deploy/web/dist/*
cp -a app/dist/. /deploy/web/dist/
- name: Health-Check
run: |
apk add --no-cache curl
sleep 3
curl -sf https://1bis.hocks.eu/ > /dev/null
curl -sf https://1bis8.hocks.eu/ > /dev/null
echo "1 bis 8 Party antwortet – Deploy erfolgreich"