Align search evidence with the portfolio structure #45
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: ['18', '20'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Verify content hashes | |
| run: | | |
| if [ -f MANIFEST.yaml ]; then | |
| ./scripts/validate-hashes.sh | |
| else | |
| echo "No MANIFEST.yaml — skipping hash verification." | |
| fi | |
| - name: Validate cross-references | |
| run: node scripts/validate.js | |
| - name: Build site (sanity check) | |
| run: node scripts/build.js | |
| - name: Build demo output (sanity check) | |
| env: | |
| KAC_OUTPUT_DIR: demo | |
| KAC_SITE_URL: https://knowledge-as-code.com/demo/ | |
| KAC_REPO_URL: https://github.com/snapsynapse/knowledge-as-code-template | |
| run: | | |
| node scripts/build.js | |
| test -f demo/index.html | |
| test -f demo/assets/styles.css | |
| test -f demo/api/v1/index.json | |
| - name: Run eval suite | |
| run: node scripts/eval.js | |
| - name: Verify generated outputs are current | |
| if: github.repository == 'snapsynapse/knowledge-as-code-template' | |
| run: | | |
| if [ -n "$(git status --porcelain --untracked-files=all -- demo)" ]; then | |
| echo "Generated demo output is not up to date. Rebuild demo/ and commit the result." | |
| git status --short --untracked-files=all -- demo | |
| exit 1 | |
| fi | |
| a11y: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build site | |
| run: node scripts/build.js | |
| - name: Discover sitemap base URL | |
| id: site | |
| run: | | |
| if [ -f docs/sitemap.xml ]; then | |
| SITE_BASE=$(grep -oE '<loc>[^<]+</loc>' docs/sitemap.xml | head -1 | sed -E 's|<loc>(.+)/?</loc>|\1|' | sed -E 's|/$||') | |
| echo "base=$SITE_BASE" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run skill-a11y-audit (WCAG 2.1 AA) | |
| uses: snapsynapse/skill-a11y-audit/.github/actions/scan@main | |
| with: | |
| serve-path: ./docs | |
| sitemap: http://localhost:8088/sitemap.xml | |
| sitemap-find: ${{ steps.site.outputs.base }} | |
| sitemap-replace: http://localhost:8088 | |
| fail-on: errors | |
| - name: Audit canonical root landing | |
| if: github.repository == 'snapsynapse/knowledge-as-code-template' | |
| uses: snapsynapse/skill-a11y-audit/.github/actions/scan@main | |
| with: | |
| serve-path: ./ | |
| port: 8089 | |
| sitemap: http://localhost:8089/tests/fixtures/a11y-root-sitemap.xml | |
| sitemap-find: https://knowledge-as-code.com | |
| sitemap-replace: http://localhost:8089 | |
| fail-on: errors | |
| artifact-name: a11y-root-results | |
| - name: Audit canonical demo deployment | |
| if: github.repository == 'snapsynapse/knowledge-as-code-template' | |
| uses: snapsynapse/skill-a11y-audit/.github/actions/scan@main | |
| with: | |
| serve-path: ./demo | |
| port: 8090 | |
| sitemap: http://localhost:8090/sitemap.xml | |
| sitemap-find: https://knowledge-as-code.com/demo | |
| sitemap-replace: http://localhost:8090 | |
| fail-on: errors | |
| artifact-name: a11y-demo-results | |
| # GitHub Pages serves directly from `main` branch root on this canonical repo. | |
| # Template-created repositories use pages.yml to build and deploy docs/ after | |
| # their Pages source is set to GitHub Actions. |