Skip to content

build(deps): bump the github-actions group with 2 updates #708

build(deps): bump the github-actions group with 2 updates

build(deps): bump the github-actions group with 2 updates #708

Workflow file for this run

name: Documentation
on:
push:
branches: [main]
paths:
- "**.md"
- "docs/**"
- ".github/workflows/docs.yml"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
- "CLAUDE.md"
pull_request:
paths:
- "**.md"
- "docs/**"
- ".github/workflows/docs.yml"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
- "CLAUDE.md"
# Cancel previous runs of the same workflow
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
# Check markdown files for issues
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "20"
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
- name: Lint markdown files
run: |
markdownlint '**/*.md' \
--ignore node_modules \
--ignore target \
--ignore docs/site \
--disable MD013 MD033 MD041
continue-on-error: true # Don't fail CI for markdown issues
# Build MkDocs documentation
mkdocs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Cache pip
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-mkdocs-material
- name: Install MkDocs and dependencies
run: |
pip install mkdocs mkdocs-material
- name: Build documentation
run: |
cd docs
mkdocs build --strict
- name: Upload build artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-site
path: docs/site
retention-days: 1
# Check for broken links in documentation
link-check:
name: Check Links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Link Checker
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
with:
args: >
--verbose
--no-progress
--skip-missing
--max-retries 3
--timeout 30
--exclude-path target
--exclude-path node_modules
--exclude-path .git
--exclude-path docs/site
--exclude "https://github.com/redis/redisctl/pull/.*"
--exclude "https://github.com/redis/redisctl/issues/.*"
.
continue-on-error: true # Don't fail CI for broken external links
# Validate that Rust documentation builds
doc-validation:
name: Validate Rust Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.9.1
with:
prefix-key: "v1-rust"
shared-key: "doc"
cache-targets: false
- name: Check that API docs build
run: cargo doc --workspace --no-deps --all-features
# Status check for documentation
docs-status:
name: Documentation Status
runs-on: ubuntu-latest
needs: [markdown-lint, mkdocs, link-check, doc-validation]
if: always()
steps:
- name: Documentation checks complete
run: |
echo "Documentation checks completed"
echo "Markdown lint: ${{ needs.markdown-lint.result }}"
echo "MkDocs build: ${{ needs.mkdocs.result }}"
echo "Link check: ${{ needs.link-check.result }}"
echo "Doc validation: ${{ needs.doc-validation.result }}"
# Only fail if MkDocs build failed (critical)
if [[ "${{ needs.mkdocs.result }}" != "success" ]]; then
echo "MkDocs build failed - this is critical"
exit 1
fi
echo "Documentation checks passed!"
# Deploy documentation to redis-field-engineering/redisctl-docs
deploy:
name: Deploy Documentation
runs-on: ubuntu-latest
needs: [mkdocs]
# Only deploy on push to main, not on PRs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Install MkDocs and dependencies
run: |
pip install mkdocs mkdocs-material
- name: Build documentation
run: |
cd docs
mkdocs build
- name: Deploy to redisctl-docs
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
personal_token: ${{ secrets.DOCS_DEPLOY_TOKEN }}
external_repository: redis-field-engineering/redisctl-docs
publish_branch: gh-pages
publish_dir: ./docs/site
commit_message: "docs: update from redis/redisctl@${{ github.sha }}"