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
109 changes: 109 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Deploy Documentation

on:
push:
branches:
- main
paths:
- 'docs/**'
- 'README.md'
- '.github/workflows/pages.yml'

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install mkdocs-material mkdocs-mermaid2-plugin

- name: Create mkdocs.yml if not exists
run: |
if [ ! -f mkdocs.yml ]; then
cat > mkdocs.yml << 'EOF'
site_name: uPKI CA Server
site_description: Certificate Authority for PKI operations
site_url: https://circle-rd.github.io/upki/

repo_url: https://github.com/circle-rd/upki
repo_name: circle-rd/upki

theme:
name: material
palette:
- scheme: default
primary: blue
accent: blue
- scheme: slate
primary: blue
accent: blue
features:
- navigation.instant
- navigation.tracking
- navigation.tabs
- search.suggest

plugins:
- mermaid2

nav:
- Home: index.md
- ZMQ Protocol: CA_ZMQ_PROTOCOL.md
- CA Specifications: SPECIFICATIONS_CA.md

markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences
- pymdownx.highlight
fi

- name: Create index.md if not exists
run: |
if [ ! -f docs/index.md ]; then
cat > docs/index.md << 'EOF'
# Welcome to uPKI CA Server

A production-ready Public Key Infrastructure (PKI) and Certificate Authority system with native ZeroMQ protocol support.

## Quick Links

- [ZMQ Protocol Specification](CA_ZMQ_PROTOCOL.md)
- [CA Specifications](SPECIFICATIONS_CA.md)
- [GitHub Repository](https://github.com/circle-rd/upki)
EOF
fi

- name: Build documentation
run: mkdocs build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root --with dev

- name: Run linter
run: |
poetry run ruff check .

- name: Run tests
run: |
poetry run pytest

docker:
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
upki
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=sha
type=raw,value=${{ github.ref_name }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test

on:
push:
branches-ignore:
- main
- master
pull_request:
branches:
- main
- master

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root --with dev

- name: Run linter
run: |
poetry run ruff check .

- name: Run tests
run: |
poetry run pytest --cov=upki_ca --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@
*.pyc
node_modules
Pipfile
Pipfile.lock
Pipfile.lock

.coverage*
coverage.xml

.pytest_cache
__pycache__
*.egg-info/
dist/
build/
*.egg

.ruff_cache
Loading
Loading