@@ -8,42 +8,32 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
# We don't use 'container:' at the top level to avoid entrypoint issues
|
container:
|
||||||
|
image: klakegg/hugo:ext-alpine # Wir bleiben bei Alpine
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: true # Hugo sites often have theme submodules
|
|
||||||
fetch-depth: 0 # Hugo needs history for .Lastmod
|
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Tools installieren
|
||||||
uses: peaceiris/actions-hugo@v3
|
# In Alpine nutzt man 'apk' statt 'apt-get'
|
||||||
with:
|
run: |
|
||||||
hugo-version: 'latest'
|
apk add --no-cache rsync openssh-client
|
||||||
extended: true
|
|
||||||
|
|
||||||
- name: Hugo Build
|
- name: Hugo Build
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Install SSH and Rsync
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y rsync openssh-client
|
|
||||||
|
|
||||||
- name: SSH vorbereiten
|
- name: SSH vorbereiten
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
# Scan the host key to avoid interactive prompts
|
# Bekannte Hosts hinzufügen
|
||||||
ssh-keyscan -H webserver.hahmann-trier.local >> ~/.ssh/known_hosts
|
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
||||||
# If ssh-keyscan fails because of your local network,
|
|
||||||
# ensure secrets.KNOWN_HOSTS is correctly set instead.
|
|
||||||
|
|
||||||
- name: Deploy via rsync
|
- name: Deploy via rsync
|
||||||
run: |
|
run: |
|
||||||
rsync -avz --delete \
|
rsync -avz --delete \
|
||||||
-e "ssh -o StrictHostKeyChecking=accept-new" \
|
-e "ssh -o StrictHostKeyChecking=accept-new -i ~/.ssh/id_ed25519" \
|
||||||
public/ \
|
public/ \
|
||||||
gitea-runner@webserver.hahmann-trier.local:/var/www/www-deepwatersurvival-de
|
gitea-runner@webserver.hahmann-trier.local:/var/www/www-deepwatersurvival-de
|
||||||
Reference in New Issue
Block a user