nav: back-link text 'Index' -> 'TOC' #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 📘 Walkthrough (GH Pages) | |
| # Deploys the walkthrough pilot to https://socketdev.github.io/socket-packageurl-js/ | |
| # Trigger: push to main that touches walkthrough sources (plus manual). | |
| # | |
| # Uses the SocketDev/socket-registry shared composite action for | |
| # checkout + Node/pnpm setup + install, so toolchain versions stay in | |
| # sync with the rest of the fleet. The build/deploy steps are custom | |
| # because there isn't a shared Pages workflow yet (worth PR'ing to | |
| # socket-registry once we've shipped this and validated the pattern). | |
| # | |
| # Build model: | |
| # 1. Shared setup-and-install → checkout w/ submodules, pnpm install. | |
| # 2. `pnpm walkthrough --minify --base-path=/socket-packageurl-js generate walkthrough.json` | |
| # The --base-path flag rewrites root-relative asset URLs and Val-Town | |
| # part links (/<slug>/part/<n>) into prefixed flat HTML paths so the | |
| # output works at socketdev.github.io/socket-packageurl-js/. --minify | |
| # runs esbuild on JS + lightningcss on CSS (~49% on-disk reduction). | |
| # 3. Upload `walkthrough/` as the Pages artifact. | |
| # 4. Deploy via actions/deploy-pages. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'walkthrough.json' | |
| - 'walkthrough-comments.js' | |
| - 'walkthrough-drag.js' | |
| - 'walkthrough-overrides.css' | |
| - 'walkthrough-sw.js' | |
| - 'scripts/walkthrough.mts' | |
| - 'src/**' | |
| - 'assets/favicon/**' | |
| - '.github/workflows/pages.yml' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| workflow_dispatch: | |
| # Default workflow-level permissions are read-only. Each job opts in | |
| # to the narrower scope it needs — build doesn't touch Pages at all | |
| # (just uploads an artifact), deploy gets pages + id-token. | |
| permissions: | |
| contents: read | |
| # Queue Pages deploys serially — don't cancel a running deploy with a | |
| # newer commit (`cancel-in-progress: false`), that can leave the site | |
| # in a half-deployed state. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build walkthrough | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Setup and install (checkout + Node + pnpm + install) | |
| uses: SocketDev/socket-registry/.github/actions/setup-and-install@d7b5d15a9be8973a5715459d12b9a033603a5ff5 # main | |
| with: | |
| checkout-fetch-depth: '1' | |
| # The fleet's shared checkout action doesn't init submodules. | |
| # We need upstream/meander because the generate step shells out | |
| # to its CLI. Init non-recursively at the pinned commit the | |
| # superrepo points at — no re-resolving from meander upstream. | |
| - name: Init meander submodule | |
| run: git submodule update --init --depth=1 upstream/meander | |
| - name: Generate walkthrough (minified, base-path=/socket-packageurl-js) | |
| run: > | |
| pnpm walkthrough | |
| --minify | |
| --base-path=/socket-packageurl-js | |
| generate walkthrough.json | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 | |
| with: | |
| path: walkthrough | |
| deploy: | |
| name: Deploy to Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deploy | |
| uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 |