This directory contains GitHub Actions workflows for automated CI/CD processes for the Open To Close API project.
Trigger: Push to main/develop branches, PRs to main/develop
Features:
- Tests on Python 3.8-3.12
- Code formatting with Black
- Import sorting with isort
- Linting with flake8
- Type checking with mypy
- Testing with pytest (100% coverage required)
- Security vulnerability scanning with safety
- Package building and validation
Trigger: Push to main/master affecting docs/, PRs, manual trigger
Features:
- Builds MkDocs documentation
- Deploys to GitHub Pages on main branch pushes
- Adds helpful PR comments for documentation changes
- Runs tests to ensure code examples work
Trigger: Version tags (e.g., v1.0.0)
Features:
- Validates version consistency across files
- Runs full test suite
- Builds and publishes to PyPI
- Creates GitHub releases with auto-generated changelogs
- Uploads build artifacts
Trigger: Push to main affecting docs/, manual trigger
Features:
- Alternative to GitHub Pages
- Deploys documentation to Netlify
- Requires
NETLIFY_AUTH_TOKENandNETLIFY_SITE_IDsecrets
Configure these in your GitHub repository settings (Settings > Secrets and variables > Actions):
OPEN_TO_CLOSE_API_KEY: Your Open To Close API key for testing
PYPI_API_TOKEN: PyPI API token for package publishing
NETLIFY_AUTH_TOKEN: Netlify authentication tokenNETLIFY_SITE_ID: Your Netlify site ID
The release workflow uses a release environment for additional protection. Configure this in:
Settings > Environments > New environment > release
You can add protection rules like:
- Required reviewers
- Wait timer
- Deployment branches (restrict to main/master)
CI runs automatically on pushes and PRs. Ensure your code:
- Passes all tests
- Is formatted with Black
- Has correct import order (isort)
- Passes type checking (mypy)
- Has 100% test coverage
Documentation deploys automatically when docs/ files change on main branch.
To preview locally: mkdocs serve
- Update version in
pyproject.tomlandopen_to_close_api/__init__.py - Commit changes
- Create and push a version tag:
git tag v1.0.1 && git push origin v1.0.1 - The release workflow will automatically:
- Test the package
- Build and publish to PyPI
- Create a GitHub release
- Update Python versions in the matrix as needed
- Keep GitHub Actions versions current
- Monitor security advisories for dependencies
- Review and update coverage requirements as project grows