Serve the website before calling blc #2
This file contains 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: Validate HTML Links | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
link-check: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# Step 2: Install a static file server and the link checker | |
- name: Install Tools | |
run: | | |
npm install -g http-server | |
npm install -g broken-link-checker | |
# Step 3: Serve the file locally | |
- name: Serve the Site | |
run: http-server ./docs -p 8080 & | |
# Step 4: Run Link Checker | |
- name: Run HTML Link Checker | |
run: blc http://127.0.0.1:8080/index.html --recursive --verbose |