Aplicando main na main e fazendo o deploy em produção #9
This file contains 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 para o server | ||
run-name: Aplicando ${{ github.ref_name }} na main e fazendo o deploy em produção | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
update-api: | ||
needs: test-code | ||
name: Atualizar API | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: appleboy/ssh-action@v0.1.10 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
cd /home/dami/napi | ||
git pull | ||
systemctl restart api | ||
script_stop: true |