Split CI into unittests and deploy workflows.
Unit Tests / test (pull_request) Successful in 15s

Unit Tests runs on pull requests and master pushes; Deploy runs only after Unit Tests succeed on a master push.
This commit is contained in:
2026-07-05 07:53:59 -05:00
parent 42ae10e6fb
commit 560485ab16
2 changed files with 31 additions and 22 deletions
+6 -22
View File
@@ -1,36 +1,20 @@
name: Deploy Company Site
on:
push:
branches: [master]
pull_request:
workflow_run:
workflows: [Unit Tests]
types: [completed]
branches: [master]
jobs:
test:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python environment
run: |
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
- name: Run unit tests
run: |
cd company_site
../.venv/bin/python manage.py test
deploy:
needs: test
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master'
if: gitea.event.workflow_run.conclusion == 'success' && gitea.event.workflow_run.event == 'push'
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ gitea.event.workflow_run.head_sha }}
- name: Deploy to live site
run: bash scripts/deploy.sh "${{ gitea.workspace }}"