fix: correct deployment workflow to force sync with remote
All checks were successful
CI / update (push) Successful in 1m11s
All checks were successful
CI / update (push) Successful in 1m11s
Fix the deployment script to properly force the remote server to always match the git repository state, regardless of local changes. Changes: - Replace invalid `git pull --force` with proper fetch and reset - Add `git remote set-url origin` to ensure correct URL with auth token - Use `git fetch origin` to download latest changes - Use `git reset --hard origin/master` to force match remote state This ensures clean deployments even if there are local modifications or conflicts on the remote server, while preserving untracked files like .env.
This commit is contained in:
@@ -28,7 +28,8 @@ jobs:
|
||||
port: 22
|
||||
script: |
|
||||
cd /usr/share/webapps/homepage
|
||||
git pull --force https://Alexander:${{ secrets.homepage_gitea_token }}@git.bocken.org/Alexander/homepage
|
||||
git remote set-url origin https://Alexander:${{ secrets.homepage_gitea_token }}@git.bocken.org/Alexander/homepage
|
||||
git fetch origin
|
||||
git reset --hard origin/master
|
||||
npm run build
|
||||
sudo systemctl restart homepage.service
|
||||
|
||||
Reference in New Issue
Block a user