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
|
||||
29
.github/workflows/deploy.yml
vendored
29
.github/workflows/deploy.yml
vendored
|
|
@ -1,29 +0,0 @@
|
|||
name: Deploy go.vanityontour.de
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install rsync
|
||||
run: sudo apt-get update && sudo apt-get install -y rsync
|
||||
|
||||
- name: Setup SSH
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -p "${{ secrets.SSH_PORT }}" "${{ secrets.SSH_HOST }}" >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy via rsync
|
||||
shell: bash
|
||||
run: |
|
||||
rsync -az --delete --exclude ".git/" --exclude ".github/" -e "ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_ed25519" ./ "${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.DEPLOY_PATH }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue