Merge branch 'main' of https://git.hahmann-trier.de/lucashahmann/www-deepwatersurvival-de
Deploy Hugo Site / deploy (push) Canceled after 0s
Deploy Hugo Site / deploy (push) Canceled after 0s
This commit is contained in:
commit
06fa91c6f6
1 file changed
+24
-9
@@ -4,32 +4,47 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
# Test
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: klakegg/hugo:ext-alpine
|
image: klakegg/hugo:ext-alpine
|
||||||
|
|
||||||
|
env:
|
||||||
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Tools installieren
|
||||||
|
run: |
|
||||||
|
apk add --no-cache rsync openssh-client
|
||||||
|
|
||||||
- name: Hugo Build
|
- name: Hugo Build
|
||||||
run: hugo
|
run: hugo --minify
|
||||||
|
|
||||||
- name: SSH vorbereiten
|
- name: SSH vorbereiten
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
# Verzeichnis sicher erstellen
|
||||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
mkdir -p /root/.ssh
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 700 /root/.ssh
|
||||||
|
|
||||||
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
# Key schreiben und sicherstellen, dass er mit einer neuen Zeile endet
|
||||||
chmod 644 ~/.ssh/known_hosts
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > /root/.ssh/id_ed25519
|
||||||
|
chmod 600 /root/.ssh/id_ed25519
|
||||||
|
|
||||||
|
# Known Hosts schreiben
|
||||||
|
echo "${{ secrets.KNOWN_HOSTS }}" > /root/.ssh/known_hosts
|
||||||
|
chmod 644 /root/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Deploy via rsync
|
- name: Deploy via rsync
|
||||||
run: |
|
run: |
|
||||||
|
# Wir nutzen den absoluten Pfad zum Key /root/.ssh/id_ed25519
|
||||||
rsync -avz --delete \
|
rsync -avz --delete \
|
||||||
|
-e "ssh -p 8147 -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new" \
|
||||||
public/ \
|
public/ \
|
||||||
gitea-runner@webserver.hahmann-trier.local:/var/www/www-deepwatersurvival-de
|
gitea-deploy@webserver.hahmann-trier.local:/var/www/www-deepwatersurvival-de
|
||||||
Reference in new issue
Block a user