45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Deploy Hugo Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-24.04
|
|
container:
|
|
image: klakegg/hugo:ext-alpine # Wir bleiben bei Alpine
|
|
|
|
env:
|
|
# Proxy-Einstellungen (WICHTIG!)
|
|
http_proxy: http://172.16.10.93:3128
|
|
https_proxy: http://172.16.10.93:3128
|
|
no_proxy: localhost,127.0.0.1,webserver.hahmann-trier.local
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Tools installieren
|
|
# In Alpine nutzt man 'apk' statt 'apt-get'
|
|
run: |
|
|
apk add --no-cache rsync openssh-client
|
|
|
|
- name: Hugo Build
|
|
run: hugo --minify
|
|
|
|
- name: SSH vorbereiten
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
# Bekannte Hosts hinzufügen
|
|
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
|
|
|
- name: Deploy via rsync
|
|
run: |
|
|
rsync -avz --delete \
|
|
-e "ssh -o StrictHostKeyChecking=accept-new -i ~/.ssh/id_ed25519" \
|
|
public/ \
|
|
gitea-runner@webserver.hahmann-trier.local:/var/www/www-deepwatersurvival-de |