Update .gitea/workflows/deploy.yml
All checks were successful
Deploy / Deploy website via rsync over SSH (push) Successful in 3s

This commit is contained in:
2025-10-30 22:48:40 +00:00
parent 1d8b50de83
commit fc55b5f5e4

View File

@@ -10,6 +10,13 @@ jobs:
name: Deploy website via rsync over SSH name: Deploy website via rsync over SSH
runs-on: [self-hosted, linux] runs-on: [self-hosted, linux]
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -32,12 +39,9 @@ jobs:
mkdir -p ~/.ssh mkdir -p ~/.ssh
chmod 700 ~/.ssh chmod 700 ~/.ssh
echo "Writing private key..." echo "$DEPLOY_KEY" > ~/.ssh/id_ed25519
# Rebuild key safely (handles single-line or escaped secrets)
echo "$DEPLOY_KEY" | tr -d '\r' | awk 'BEGIN {RS="\\n"} {print}' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
echo "Adding ${DEPLOY_HOST}:${DEPLOY_PORT} to known_hosts..."
ssh-keyscan -p "$DEPLOY_PORT" -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null ssh-keyscan -p "$DEPLOY_PORT" -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null
echo "SSH setup complete." echo "SSH setup complete."
shell: bash shell: bash