From ac006e88b34bc7734b45d8ae0c85a8492957d15b Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 7 Jul 2025 23:23:59 +0900 Subject: [PATCH] Fix file overwrite permission issues in deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Exclude .git directory from tar archive - Clean target directory before extraction - Prevent file exists and permission denied errors - Ensure clean deployment without conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 64a8eb2..bb363e2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,10 +46,10 @@ jobs: ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \ "which rsync && rsync --version" - - name: Alternative deployment via tar and SSH + - name: Clean and deploy via tar and SSH run: | - tar czf - . | ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \ - "cd /volume1/homes/admin/nginx-infra && tar xzf -" + tar czf - --exclude='.git' . | ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \ + "rm -rf /volume1/homes/admin/nginx-infra/* && cd /volume1/homes/admin/nginx-infra && tar xzf -" - name: Check Docker permissions run: |