Use temporary directory for safe deployment

- Extract files to /tmp first to avoid permission issues
- Use sudo rsync --delete for clean deployment
- Remove temporary files after deployment
- Handles root-owned files in target directory

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
happybell80 2025-07-07 23:31:04 +09:00
parent ac006e88b3
commit 9b0c1ee117

View File

@ -46,10 +46,10 @@ jobs:
ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \
"which rsync && rsync --version"
- name: Clean and deploy via tar and SSH
- name: Deploy to temporary location and move
run: |
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 -"
"mkdir -p /tmp/nginx-infra-deploy && cd /tmp/nginx-infra-deploy && tar xzf - && sudo rsync -av --delete /tmp/nginx-infra-deploy/ /volume1/homes/admin/nginx-infra/ && rm -rf /tmp/nginx-infra-deploy"
- name: Check Docker permissions
run: |