Deploy von GitHub Actions auf Forgejo Actions umgestellt
All checks were successful
Deploy go.vanityontour.de / deploy (push) Successful in 22s
All checks were successful
Deploy go.vanityontour.de / deploy (push) Successful in 22s
Die Seite liegt seit dem Shlink-Umzug nicht mehr auf dem Hetzner-Server, sondern als Container-Volume unter /docker/shlink/landingpage auf dem Hostinger-VPS. Der alte Workflow htte weiter ins Leere deployed. Der neue Workflow laeuft auf dem act_runner, der ohnehin auf dem Zielhost steht, und mountet das Zielverzeichnis direkt in den Job-Container. Damit entfaellt der SSH-Umweg und ein Deploy-Key als Secret. .github/workflows/ wird entfernt, weil Forgejo Actions dieses Verzeichnis ebenfalls auswertet und der alte Job dort scheitern wuerde. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
f5d030d9c3
commit
4376918e73
2 changed files with 45 additions and 29 deletions
45
.forgejo/workflows/deploy.yml
Normal file
45
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
name: Deploy go.vanityontour.de
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: alpine
|
||||
container:
|
||||
image: node:20-alpine
|
||||
# Das Zielverzeichnis liegt auf demselben Host wie der Runner und wird
|
||||
# vom nginx-Container des Shlink-Stacks read-only gelesen. Direktes
|
||||
# Mounten spart den Umweg ueber SSH und damit einen Deploy-Key.
|
||||
# Freigegeben in /docker/act_runner/config.yaml (valid_volumes).
|
||||
volumes:
|
||||
- /docker/shlink/landingpage:/target
|
||||
steps:
|
||||
- name: rsync bereitstellen
|
||||
run: apk add --no-cache rsync
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
rsync -a --delete \
|
||||
--exclude '.git/' \
|
||||
--exclude '.github/' \
|
||||
--exclude '.forgejo/' \
|
||||
--exclude '.claude/' \
|
||||
--exclude '*.md' \
|
||||
./ /target/
|
||||
echo "Deployed:"
|
||||
ls -la /target
|
||||
|
||||
- name: Smoke-Test
|
||||
run: |
|
||||
apk add --no-cache curl
|
||||
for path in / /assets/css/style.css /robots.txt; do
|
||||
code=$(curl -s -o /dev/null -w '%{http_code}' "https://go.vanityontour.de${path}")
|
||||
echo " ${path} -> ${code}"
|
||||
[ "$code" = "200" ] || exit 1
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue