SOP: Dev to Prod Development - sdwilt-dtech/aussie2 GitHub Wiki
This repository uses GitHub Actions for automated testing, linting, and deployment for Linux-based applications.
bashCopyEditpython3 -m venv venv source venv/bin/activate pip install -r requirements.txt pre-commit install
Run:
bashCopyEditmake check # or python cli.py check
Triggered on every push
and pull_request
:
-
Lints code with
flake8
-
Checks formatting with
black
-
Runs tests using
pytest
-
Create a feature branch:
bashCopyEditgit checkout -b feature/xyz
-
Run checks locally:
bashCopyEditmake check
-
Push and open a pull request.
-
GitHub Actions auto-runs the CI checks.
-
Only merge once:
-
โ All checks pass
-
โ Code is reviewed
-
-
Main branch is protected.
-
Rules:
-
โ Require status checks to pass
-
โ Require PR before merge
-
โ Optional: Require at least one reviewer
-
You can trigger a deployment workflow using GitHub Actions when pushing tags like v1.0.0
.
yamlCopyEditon: push: tags: - 'v*.*.*' jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: SSH Deploy run: ssh ${{ secrets.PROD_USER }}@${{ secrets.PROD_HOST }} << EOF cd /var/www/app git pull origin main sudo systemctl restart app.service EOF
File | Purpose
-- | --
.github/workflows/test.yml | CI workflow
Makefile / cli.py | Developer shortcuts
.flake8 | Lint config
.pre-commit-config.yaml | Git hook setup
deploy.yml | Deployment workflow (optional)