Updating pre-commit #32
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: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Build Docker image | |
| run: docker build -t codeink:test . | |
| - name: Verify container starts | |
| run: | | |
| docker run -d --name codeink-test -p 8080:80 codeink:test | |
| sleep 2 | |
| curl -f http://localhost:8080/ || (docker logs codeink-test && exit 1) | |
| docker stop codeink-test | |
| html-validate: | |
| name: Validate HTML | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Check for broken CDN links | |
| run: | | |
| echo "Checking highlight.js CDN links..." | |
| grep -oP 'https://cdnjs\.cloudflare\.com[^"]+' static/index.html | while read url; do | |
| echo " Checking: $url" | |
| curl -sf --head "$url" > /dev/null || { echo " BROKEN: $url"; exit 1; } | |
| done | |
| echo "All CDN links valid." |