Add GitHub Actions workflow for website deployment

Creates automated build and deployment pipeline for the documentation website:

Workflow features:
- Triggers on push to main or create-documentation-site-for-keymaps branch
- Triggers on changes to layout.yaml, website/, scripts/, or workflow file
- Manual trigger via workflow_dispatch

Build steps:
1. Setup Python 3.12 for keymap-drawer
2. Setup Node.js 20 for Eleventy
3. Install dependencies (keymap-drawer, npm packages)
4. Generate SVG diagrams from layout.yaml
5. Build static site with Eleventy
6. Create .nojekyll file to disable Jekyll processing
7. Deploy to GitHub Pages

The workflow uses the official GitHub Pages deployment actions and includes
proper permissions and concurrency controls to prevent deployment conflicts.

Next step: Enable GitHub Pages in repository settings
(Settings → Pages → Source: GitHub Actions)
This commit is contained in:
Drew Neil 2026-01-04 22:58:11 +00:00
commit 7b45dd8cd9

78
.github/workflows/build_website.yaml vendored Normal file
View file

@ -0,0 +1,78 @@
name: Build and Deploy Documentation Website
on:
push:
branches:
- main
- create-documentation-site-for-keymaps
paths:
- 'keyboards/**/layout.yaml'
- 'website/**'
- 'scripts/**'
- '.github/workflows/build_website.yaml'
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: website/package-lock.json
- name: Install keymap-drawer
run: pip install keymap-drawer
- name: Install Node.js dependencies
working-directory: website
run: npm ci
- name: Generate SVG diagrams
run: node scripts/generate-svgs.js
- name: Build website with Eleventy
working-directory: website
run: npm run build
- name: Create .nojekyll file
working-directory: website
run: touch _site/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: website/_site
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4