.yml file
`
### Problem
I have a Node.js + React project hosted on a **Windows server (F:\PSBA_TMS)**.
I’m using **GitHub Actions** with `appleboy/ssh-action` to deploy my latest changes to the server.
The workflow **runs successfully**, but when I check the server, it **still has old code**.
---
### Workflow snippet (PowerShell via SSH)
```yaml
- name: Deploy to staging server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: 22
script: |
Write-Host "--- Connected to server ---"
\# Update repo
Set-Location 'F:\\PSBA_TMS'
git fetch origin
git checkout staging
git reset --hard origin/staging
git clean -fd
\# Backend
Set-Location 'Ticketing-Management-System-Backend-'
npm install
pm2 reload ecosystem.config.cjs --env staging || pm2 start ecosystem.config.cjs --env staging
\# Frontend
Set-Location '..\\Ticketing-Management-System-React'
npm install
npm run build
Why does the workflow complete successfully but the server doesn’t actually update to the latest code?
Could this be related to PM2 caching, PowerShell session scope, or GitHub Actions SSH behavior?
How can I ensure the server always runs the latest backend and frontend code after the workflow?