diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fea4091..6cf72b8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,6 @@ jobs: host: ${{ secrets.SERVER_HOST }} username: ${{ secrets.SERVER_USERNAME }} key: ${{ secrets.SERVER_SSH_KEY }} - passphrase: ${{ secrets.SERVER_PASSPHRASE }} script: | IMAGE_REFERENCE="ghcr.io/sn0wye/caho-api:${{ github.sha }}" diff --git a/.github/workflows/update-nginx.yml b/.github/workflows/update-nginx.yml new file mode 100644 index 0000000..dac6417 --- /dev/null +++ b/.github/workflows/update-nginx.yml @@ -0,0 +1,33 @@ +name: Update Nginx Config + +on: + push: + paths: + - 'nginx/nginx.conf' + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Copy nginx.conf to server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USERNAME }} + key: ${{ secrets.SERVER_SSH_KEY }} + source: 'nginx/nginx.conf' + target: '/etc/nginx/sites-available/api.caho.com.br' + + - name: Restart Nginx + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USERNAME }} + key: ${{ secrets.SERVER_SSH_KEY }} + script: | + sudo systemctl restart nginx