Deployment Guide¶
This guide covers all deployment processes for the ReZEN Python client, consolidated into GitHub Actions workflows.
๐ Quick Overview¶
All deployments are handled automatically through GitHub Actions:
- Code Quality: Automatic on every push/PR
- Testing: Automatic on every push/PR
- Documentation: Automatic on docs changes
- Releases: Manual trigger or tag-based
๐ Prerequisites¶
GitHub Secrets¶
Ensure these secrets are configured in your repository:
# Required for all deployments
REZEN_API_KEY # For running tests
GITHUB_TOKEN # Auto-provided
# Required for PyPI publishing
PYPI_API_TOKEN # PyPI API token
๐ Automated Workflows¶
1. Continuous Integration (ci.yml
)¶
Triggers: Every push/PR to main
or develop
What it does: - โ Code quality checks (Black, isort, flake8, mypy) - ๐ Security scanning (Bandit, Safety) - ๐ Config validation (YAML, TOML) - ๐งช Test suite across Python 3.8-3.12 - ๐ฆ Package build verification
2. Documentation (docs.yml
)¶
Triggers: Changes to docs/
, mkdocs.yml
, or code
What it does: - ๐ Auto-sync API coverage - ๐ Build documentation with MkDocs - ๐ Deploy to GitHub Pages - ๐ฌ PR comments with build status
3. Release (release.yml
)¶
Triggers: - Tag push (v*
) - Manual workflow dispatch
What it does: - ๐ท๏ธ Version bumping (manual releases) - โ
Full test suite - ๐ฆ Package building
- ๐ PyPI publishing - ๐ GitHub release creation - ๐ Automatic changelog generation
๐ ๏ธ Manual Operations¶
Creating a Release¶
Option 1: Manual Release (Recommended)¶
- Go to Actions โ Release โ Run workflow
- Enter version (e.g.,
1.2.3
) - Optionally mark as prerelease
- Click Run workflow
The workflow will: - Validate version format - Update pyproject.toml
and rezen/__init__.py
- Create and push the git tag - Run tests and build - Publish to PyPI - Create GitHub release
Option 2: Tag-based Release¶
# Update versions manually
vim pyproject.toml # Update version = "1.2.3"
vim rezen/__init__.py # Update __version__ = "1.2.3"
# Commit and tag
git add pyproject.toml rezen/__init__.py
git commit -m "Bump version to 1.2.3"
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin main --tags
Local Development¶
Documentation¶
# Install dependencies
pip install -r docs/requirements.txt
# Serve locally
mkdocs serve
# Build for testing
mkdocs build
Testing¶
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest --cov=rezen
# Run quality checks
black --check .
isort --check .
flake8 .
mypy rezen/
๐ง Configuration Files¶
Minimal Configuration¶
The following files are no longer needed and have been consolidated into GitHub Actions:
- โ
.pre-commit-config.yaml
โ Integrated into CI workflow - โ
scripts/bump_version.py
โ Integrated into release workflow - โ
scripts/sync_docs.py
โ Integrated into docs workflow - โ ๏ธ
.readthedocs.yml
โ Optional (if using RTD alongside GitHub Pages)
Required Files¶
- โ
.github/workflows/
โ All automation - โ
mkdocs.yml
โ Documentation config - โ
pyproject.toml
โ Package config - โ
requirements.txt
&requirements-dev.txt
โ Dependencies
๐จ Troubleshooting¶
Release Issues¶
Version mismatch errors:
# Check current versions
grep version pyproject.toml
grep __version__ rezen/__init__.py
# Ensure they match your intended version
PyPI publishing fails: - Verify PYPI_API_TOKEN
secret is set - Check if version already exists on PyPI - Ensure package builds successfully
Documentation Issues¶
Build failures: - Check MkDocs configuration in mkdocs.yml
- Verify all referenced files exist - Check for syntax errors in markdown
CI Issues¶
Code quality failures:
Test failures: - Ensure REZEN_API_KEY
is set in secrets - Check for environment-specific issues - Verify all dependencies are installed
๐ Monitoring¶
Workflow Status¶
Monitor deployments at: - GitHub Actions: Repository โ Actions tab - PyPI: https://pypi.org/project/rezen/ - GitHub Pages: https://theperrygroup.github.io/rezen/
Coverage Reports¶
- Codecov: Automatic uploads from CI
- Security: Bandit reports in CI artifacts
- Dependencies: Dependabot PRs for updates
๐ฏ Best Practices¶
- Always test locally before pushing
- Use manual releases for better control
- Write descriptive commit messages for better changelogs
- Keep dependencies updated via Dependabot
- Monitor workflow runs for issues
- Use semantic versioning (e.g., 1.2.3)
๐ Support¶
If workflows fail or you need help:
- Check workflow logs in GitHub Actions
- Review this guide for common issues
- Check repository Issues for known problems
- Create a new issue with workflow logs attached