Skip to content

Commit

Permalink
feat: update nginx pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wye committed Aug 3, 2024
1 parent e3aad50 commit becfd72
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/update-nginx.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit becfd72

Please sign in to comment.