debug #141
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: Deploy to VM | |
| on: | |
| push: | |
| branches: | |
| - main # il branch che vuoi monitorare | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup SSH | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Deploy code and restart service | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} " | |
| cd ${{ secrets.SERVER_PATH }} | |
| git pull origin main | |
| sudo systemctl restart ${{ secrets.SERVICE_NAME }} | |
| sudo systemctl restart money.service | |
| " |