Skip to content

Commit 01e9d45

Browse files
committed
use published workflow
1 parent 5b8bb25 commit 01e9d45

1 file changed

Lines changed: 7 additions & 46 deletions

File tree

.github/workflows/a11y.yml

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,15 @@ on:
55
branches:
66
- master
77
pull_request:
8-
env:
9-
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
10-
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
11-
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
12-
BASE_URL: /${{ github.event.repository.name }}
138

149
jobs:
15-
axe-check:
10+
check-a11y:
1611
runs-on: ubuntu-latest
1712
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Setup Node.js
22-
uses: actions/setup-node@v4
23-
with:
24-
node-version: '20'
25-
26-
- name: Installs
27-
run: npm install jupyter-book selenium-webdriver @axe-core/webdriverjs chromedriver http-server wait-on
28-
29-
- name: Build Jupyter Book
30-
run: npx jupyter-book build --html
31-
32-
- name: Run Axe Checks
33-
run: |
34-
35-
# A. Create a subdirectory structure that matches the BASE_URL
36-
# This ensures http://localhost:8080/textbook/index.html works
37-
mkdir -p staging${BASE_URL}
38-
cp -r _build/html/* staging${BASE_URL}/
39-
40-
# B. Start server pointing to the staging root
41-
npx http-server staging -p 8080 -s &
42-
npx wait-on http://localhost:8080${BASE_URL}/
43-
44-
# C. Generate URLs including the BASE_URL prefix
45-
cd _build/html
46-
# We add the BASE_URL to the string via sed
47-
URLS=$(find . -name "*.html" -not -path "*/build/*" | sed 's|^\./||' | sed "s|^|http://localhost:8080${BASE_URL}/|" | tr '\n' ' ')
48-
cd ../..
49-
50-
# D. Run custom script
51-
node axe-scan.js $URLS
52-
53-
- name: Upload Accessibility Report
54-
if: always()
55-
uses: actions/upload-artifact@v4
13+
- uses: actions/checkout@v4
14+
15+
- name: Run Accessibility Checks
16+
uses: berkeley-cdss/myst-a11y@v1
5617
with:
57-
name: axe-report
58-
path: axe-report.json
18+
base_url: '/${{ github.event.repository.name }}'
19+
exclude: "iframe[src*='youtube.com'], #movie_player"

0 commit comments

Comments
 (0)