Skip to content

fix: backup command calls internal function, not Click push directly #127

fix: backup command calls internal function, not Click push directly

fix: backup command calls internal function, not Click push directly #127

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Run tests first to ensure code is valid
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir -e ".[dev]"
- name: Run tests
run: pytest tests/ -v --tb=short
# Build and validate documentation
build-docs:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir -r docs/requirements.txt
pip install --no-cache-dir -e .
- name: Generate CLI documentation
run: |
python scripts/generate_cli_docs.py
- name: Build documentation
run: mkdocs build --strict --site-dir site_docs
- name: Validate documentation structure
run: |
# Verify required files exist
echo "Checking documentation structure..."
if [ ! -f "site_docs/index.html" ]; then
echo "ERROR: Missing site_docs/index.html"
exit 1
fi
if [ ! -f "site_docs/cli/index.html" ]; then
echo "ERROR: Missing site_docs/cli/index.html"
exit 1
fi
if [ ! -f "site_docs/quickstart/index.html" ]; then
echo "ERROR: Missing site_docs/quickstart/index.html"
exit 1
fi
if [ ! -f "site_docs/protocols/dotagents/index.html" ]; then
echo "ERROR: Missing site_docs/protocols/dotagents/index.html"
exit 1
fi
if [ ! -f "site_docs/protocols/gitagent/index.html" ]; then
echo "ERROR: Missing site_docs/protocols/gitagent/index.html"
exit 1
fi
echo "✅ All required documentation files exist"
- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v3
with:
name: site-docs
path: site_docs
# Deploy site
deploy:
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir -r docs/requirements.txt
- name: Download documentation artifact
uses: actions/download-artifact@v4
with:
name: site-docs
path: site_docs
- name: Create deployment directory
run: |
# Create root and docs directories
mkdir -p _site
mkdir -p _site/docs
# Copy main site to root
cp index.html _site/
# Copy all site_docs content to /docs
cp -r site_docs/* _site/docs/
# Verify structure
echo "=== Deployment structure ==="
echo "Root files:"
ls -la _site/
echo ""
echo "Docs files:"
ls -la _site/docs/
# Critical check: both index.html files must exist
if [ ! -f "_site/index.html" ]; then
echo "ERROR: Root index.html missing!"
exit 1
fi
if [ ! -f "_site/docs/index.html" ]; then
echo "ERROR: Docs index.html missing!"
exit 1
fi
echo "✅ Both root and docs index.html exist"
echo "✅ Deployment structure is valid"
- name: Upload site artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4