acode.app/main - 45 #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Dev Server | |
| run-name: acode.app/main - ${{ github.run_number }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| Deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_KEY }} | |
| passphrase: ${{ secrets.SSH_PASSPHRASE }} | |
| script: | | |
| export PATH="/home/${{ secrets.SSH_USER }}/.nvm/versions/node/v22.12.0/bin/:$PATH" | |
| if ! command -v git &> /dev/null | |
| then | |
| sudo apt-get update | |
| sudo apt-get install -y git | |
| fi | |
| cd ~/sites/acode.app | |
| git restore . | |
| git pull | |
| npm install | |
| npm run build | |
| pm2 restart acode.app |