Skip to content

style: polish single-page landing experience #749

style: polish single-page landing experience

style: polish single-page landing experience #749

Workflow file for this run

name: Build and Deploy Docs
on:
push:
branches:
- main
paths-ignore:
- '.devcontainer/**'
- 'AGENTS.md'
- '.github/copilot-instructions.md'
- '.cursorrules'
- '.cursor/rules/**'
- 'Makefile'
- 'doc-cli'
- 'doc-cli/**'
- 'doc-cli.sh'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
pull_request:
paths-ignore:
- '.devcontainer/**'
- 'AGENTS.md'
- '.github/copilot-instructions.md'
- '.cursorrules'
- '.cursor/rules/**'
- 'Makefile'
- 'doc-cli'
- 'doc-cli/**'
- 'doc-cli.sh'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (e.g., 0.4.0). Required for deployment.'
required: true
type: string
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
# Build job - runs on push and PR to validate the site builds
# On push to main, also auto-deploys the next patch version
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: uv pip install --system -r requirements.txt
- name: Run e2e structure checks
if: github.event_name == 'pull_request'
run: |
uv pip install --system pytest pytest-playwright
playwright install chromium
python -m pytest e2e/test_structure.py -v
- name: Build site with Zensical
run: |
echo "Building site with Zensical..."
zensical build
echo "Build complete!"
touch site/.nojekyll
# Verify Three.js assets
if [ -d "site/assets/js/threejs-background" ]; then
echo "Three.js assets found"
else
echo "WARNING: Three.js assets NOT found!"
fi
- name: Get current deployed version
id: current
run: |
git fetch origin gh-pages --depth=1 2>/dev/null || true
CURRENT="0.0.0"
if git show origin/gh-pages:versions.json > /tmp/versions.json 2>/dev/null; then
CURRENT=$(python -c "
import json
try:
with open('/tmp/versions.json') as f:
data = json.load(f)
for v in data:
if 'latest' in v.get('aliases', []):
print(v['version'])
exit(0)
print(data[0]['version'] if data else '0.0.0')
except Exception as e:
print('0.0.0')
")
fi
echo "version=${CURRENT}" >> $GITHUB_OUTPUT
echo "Current deployed version: ${CURRENT}"
- name: Suggest next version
id: suggest
run: |
CURRENT="${{ steps.current.outputs.version }}"
if [ -z "$CURRENT" ] || [ "$CURRENT" = "0.0.0" ]; then
NEXT="0.1.0"
else
IFS='.' read -r major minor patch <<< "$CURRENT"
patch=${patch:-0}
NEXT="${major}.${minor}.$((patch + 1))"
fi
echo "version=${NEXT}" >> $GITHUB_OUTPUT
echo "Suggested next version: ${NEXT}"
- name: Auto-deploy to gh-pages
if: github.event_name == 'push'
env:
NEXT_VERSION: ${{ steps.suggest.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
python scripts/python/versioned_deploy.py deploy \
"$NEXT_VERSION" \
--alias latest \
--push \
--no-build
- name: Build summary (push)
if: github.event_name == 'push'
env:
NEXT_VERSION: ${{ steps.suggest.outputs.version }}
run: |
echo "## Deployed $NEXT_VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Auto-deployed version **$NEXT_VERSION** to GitHub Pages." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **URL:** https://ba-calderonmorales.github.io/my-life-as-a-dev/" >> $GITHUB_STEP_SUMMARY
echo "- **Versioned:** https://ba-calderonmorales.github.io/my-life-as-a-dev/$NEXT_VERSION/" >> $GITHUB_STEP_SUMMARY
- name: Build summary (PR)
if: github.event_name == 'pull_request'
run: |
echo "## Build Successful" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Site builds correctly. Merge to deploy." >> $GITHUB_STEP_SUMMARY
# Deploy job - only runs on workflow_dispatch for custom version overrides
deploy:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: uv pip install --system -r requirements.txt
- name: Build site
run: zensical build
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy version ${{ inputs.version }}
run: |
python scripts/python/versioned_deploy.py deploy \
"${{ inputs.version }}" \
--alias latest \
--push \
--no-build
- name: Deployment summary
run: |
echo "## Deployed version ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **URL:** https://ba-calderonmorales.github.io/my-life-as-a-dev/" >> $GITHUB_STEP_SUMMARY
echo "- **Versioned:** https://ba-calderonmorales.github.io/my-life-as-a-dev/${{ inputs.version }}/" >> $GITHUB_STEP_SUMMARY