Attendance/.github/workflows/main.yml
2021-10-27 18:24:55 +08:00

25 lines
560 B
YAML

name: Flask CICD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: CD
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
KEY: ${{ secrets.SSHKEY }}
script: |
cd /home/ubuntu/Attendance
git pull
source ./Attendance/bin/activate
pip install -r requirements.txt
deactivate
sudo systemctl restart Attendance.service