Skip to content

Change to browse cheatsheets #65

Change to browse cheatsheets

Change to browse cheatsheets #65

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Don't cancel in-progress deployments on main; do cancel stale PR builds
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
- name: Restore Next.js cache
uses: actions/cache@v5
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx', '**.[jt]s') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Install dependencies
run: npm ci
- name: Audit dependencies
# Informational only - findings are printed to the log but never block the build
run: npm audit --audit-level=none
continue-on-error: true
- name: Type check
run: npx tsc --noEmit
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Setup just
uses: extractions/setup-just@v3
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install Graphviz
run: brew install graphviz
- name: Generate architecture diagrams
# Regenerates SVGs into public/assets/diagrams/ from the diagram-as-code
# sources so the deployed site always matches architecture/*.py.
run: just diagrams
- name: Build site
run: npm run build
env:
NEXT_TELEMETRY_DISABLED: 1
- name: Publish build summary
run: |
echo "# Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Ref:** \`${{ github.ref }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Output:** \`out/\`" >> $GITHUB_STEP_SUMMARY
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v5
with:
path: out/
deploy:
name: Deploy to GitHub Pages
needs: build
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5