Skip to content

Daily 404 Check

Daily 404 Check #186

name: Daily 404 Check
on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
check-404:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Start documentation server
run: |
docker pull ghcr.io/healthsamurai/documentation:latest
docker run -d \
-p 8081:8081 \
-e BASE_URL=http://localhost:8081 \
-e DEV=true \
-e DOCS_PREFIX=/docs \
-e DOCS_REPO_PATH=/repo \
-e DOCS_VOLUME_PATH=/repo/docs-new \
-e PORT=8081 \
-e RELOAD_CHECK_INTERVAL_SEC=10 \
-e EXAMPLES_UPDATE_INTERVAL=1 \
-v $(pwd):/repo:ro \
--name docs-server \
--rm \
ghcr.io/healthsamurai/documentation:latest
- name: Wait for server to start
run: |
timeout 120 bash -c 'until curl -f http://localhost:8081/docs/aidbox; do sleep 2; done'
- name: Run 404 check script
run: |
python3 scripts/check_local_urls.py
- name: Cleanup
if: always()
run: |
docker stop docs-server || true
docker rm docs-server || true