From 4376918e735040e0dd76db4a468a94e775a990ea Mon Sep 17 00:00:00 2001 From: Oliver Giertz Date: Mon, 27 Jul 2026 09:12:36 +0200 Subject: [PATCH] Deploy von GitHub Actions auf Forgejo Actions umgestellt 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 --- .forgejo/workflows/deploy.yml | 45 +++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 29 ---------------------- 2 files changed, 45 insertions(+), 29 deletions(-) create mode 100644 .forgejo/workflows/deploy.yml delete mode 100644 .github/workflows/deploy.yml diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..d46db3f --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7bc177a..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -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 }}"