diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 75c7e706..cb51c42e 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -7,7 +7,6 @@ on: jobs: deploy: - # Target ONLY the shell label to run directly on the host VPS instead of inside a container runs-on: shell steps: @@ -22,7 +21,10 @@ jobs: # 2. Navigate to your website directory cd /var/www/atom-nexst/ - # 3. Fetch and update code using the local web user to maintain SSH permissions + # Fix ownership to ensure www-data owns the files before Git runs + sudo chown -R www-data:www-data .git/ + + # 3. Fetch and update code using the local web user sudo -u www-data git fetch origin --prune sudo -u www-data git reset --hard origin/main