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:
parent
ac006e88b3
commit
9b0c1ee117
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -46,10 +46,10 @@ jobs:
|
|||||||
ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \
|
ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \
|
||||||
"which rsync && rsync --version"
|
"which rsync && rsync --version"
|
||||||
|
|
||||||
- name: Clean and deploy via tar and SSH
|
- name: Deploy to temporary location and move
|
||||||
run: |
|
run: |
|
||||||
tar czf - --exclude='.git' . | ssh -p ${{ secrets.NAS_PORT }} admin@${{ secrets.NAS_HOST }} \
|
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
|
- name: Check Docker permissions
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user