Skip to content

adding folder to organize deployment and adding new github action #4

adding folder to organize deployment and adding new github action

adding folder to organize deployment and adding new github action #4

Workflow file for this run

on:
push:
branches:
- main
paths:
- nginx.conf
name: update nginx
jobs:
update-nginx:
name: Update & Restart Nginx
runs-on: ubuntu-latest
steps:
- name: Execute pull scripts on EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.AWS_USERNAME }}
key: ${{ secrets.AWS_KEY }}
script: |
cd /home/ec2-user/byte-server
git add .
git stash
git checkout main
git pull
sudo cp nginx.conf /etc/nginx/nginx.conf
sudo nginx -s reload