From fc55b5f5e44fc1f946a6c077e327c6f195533163 Mon Sep 17 00:00:00 2001 From: Alek Nikovich Date: Thu, 30 Oct 2025 22:48:40 +0000 Subject: [PATCH] Update .gitea/workflows/deploy.yml --- .gitea/workflows/deploy.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 0614a74..21fc6da 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -10,6 +10,13 @@ jobs: name: Deploy website via rsync over SSH 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: - name: Checkout repository uses: actions/checkout@v3 @@ -32,12 +39,9 @@ jobs: mkdir -p ~/.ssh chmod 700 ~/.ssh - echo "Writing private key..." - # Rebuild key safely (handles single-line or escaped secrets) - echo "$DEPLOY_KEY" | tr -d '\r' | awk 'BEGIN {RS="\\n"} {print}' > ~/.ssh/id_ed25519 + echo "$DEPLOY_KEY" > ~/.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 echo "SSH setup complete." shell: bash