add redirects #21
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: Accessibility Checks | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| axe-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Installs | |
| run: npm install jupyter-book selenium-webdriver @axe-core/webdriverjs chromedriver http-server wait-on | |
| - name: Build Jupyter Book | |
| run: npx jupyter-book build --html | |
| - name: Run Axe Checks | |
| run: | | |
| # A. Start a local server in the background | |
| npx http-server ./_build/html -p 8080 -s & | |
| npx wait-on http://localhost:8080 | |
| # B. Generate the URL list from the actual build artifacts | |
| cd _build/html | |
| URLS=$(find . -name "*.html" -not -path "*/build/*" | sed 's|^\./||' | sed 's|^|http://localhost:8080/|' | tr '\n' ' ') | |
| cd ../.. | |
| # C. Run custom script | |
| node axe-scan.js $URLS | |
| - name: Upload Accessibility Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: axe-report | |
| path: axe-report.json |