Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CD pipeline to auto-deploy on merges to main

on:
push:
branches:
- main

jobs:
auto-deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- name: deploy app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd commit-quality-monitor
git pull origin main
source ./venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart fastapi
sudo systemctl restart nginx
27 changes: 27 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI pipeline to run pytest on pull requests

on:
pull_request:
branches:
- staging

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository for workflow access
uses: actions/checkout@v4

- name: set up python environment
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: run tests
run: |
pytest
Loading