From 7b45dd8cd9c9d0695e9f060f295dfdcfb784c58d Mon Sep 17 00:00:00 2001 From: Drew Neil Date: Sun, 4 Jan 2026 22:58:11 +0000 Subject: [PATCH] Add GitHub Actions workflow for website deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/build_website.yaml | 78 ++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/build_website.yaml diff --git a/.github/workflows/build_website.yaml b/.github/workflows/build_website.yaml new file mode 100644 index 00000000..d47aa735 --- /dev/null +++ b/.github/workflows/build_website.yaml @@ -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