From 41f6366e33c3c7af0e663ad50d3420d288fb674c Mon Sep 17 00:00:00 2001 From: Lars Nolden Date: Tue, 23 Jun 2026 22:10:07 +0200 Subject: [PATCH] update deploy script --- .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 ec2e900..9b78e09 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -31,11 +31,15 @@ jobs: chmod 600 ~/.ssh/id_ed25519 - name: Deploy static files to server + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + REMOTE_DIR: /home/deploy/projects/ge-bos/static run: | - rsync -avz --delete \ - -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new" \ - out/ \ - deploy@${{ secrets.DEPLOY_HOST }}:/home/deploy/projects/ge-bos/static/ + SSH="ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new" + # Recreate the target dir so removed files don't linger (rsync --delete equivalent) + $SSH deploy@"$DEPLOY_HOST" "rm -rf '$REMOTE_DIR' && mkdir -p '$REMOTE_DIR'" + # Stream the build output over ssh and extract it on the server + tar -czf - -C out . | $SSH deploy@"$DEPLOY_HOST" "tar -xzf - -C '$REMOTE_DIR'" - name: Run deployment script run: |