Skip to content

ci: Force GitHub Pages rebuild and add .nojekyll file #15

ci: Force GitHub Pages rebuild and add .nojekyll file

ci: Force GitHub Pages rebuild and add .nojekyll file #15

Workflow file for this run

name: Deploy MkDocs
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/deploy-docs.yml'
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
# Set up Python and cache dependencies
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
cache: pip
cache-dependency-path: docs/requirements.txt
# Install Python dependencies
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
# Set up Node.js and cache dependencies
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: docs/package-lock.json
# Install Node.js dependencies
- name: Install Node.js dependencies
working-directory: ./docs
run: npm ci || npm install
# Lint Markdown files (but don't fail the build)
- name: Lint Markdown files
working-directory: ./docs
run: npm run lint || echo "Lint check skipped, continuing deployment"
# Check for broken links or references (but don't fail the build)
- name: Check for broken links
run: |
cd docs
npm run links || echo "Link check found issues, review logs for details"
continue-on-error: true
# Build documentation
- name: Build documentation
run: mkdocs build --strict
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: site
branch: gh-pages
clean: true
clean-exclude: |
.nojekyll
CNAME
force: true
# Verify deployment
- name: Verify deployment
run: |
echo "Documentation deployed to GitHub Pages"
echo "Visit https://mitre.github.io/kube-secure-scanner/ to view the documentation"
echo "Note: It may take a few minutes for changes to propagate"