Skip to content

chore: release

chore: release #276

Workflow file for this run

name: Documentation
on:
push:
branches: [main]
paths:
- "**.md"
- "docs/**"
- ".github/workflows/docs.yml"
- "book.toml"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
- "CLAUDE.md"
pull_request:
branches: [main]
paths:
- "**.md"
- "docs/**"
- ".github/workflows/docs.yml"
- "book.toml"
- "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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@v4
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/book \
--disable MD013 MD033 MD041
continue-on-error: true # Don't fail CI for markdown issues
# Build and test mdBook documentation
mdbook:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache mdBook
uses: actions/cache@v4
id: mdbook-cache
with:
path: ~/.cargo/bin/mdbook
key: ${{ runner.os }}-mdbook-0.4.40
- name: Install mdBook
if: steps.mdbook-cache.outputs.cache-hit != 'true'
run: |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz
mv mdbook ~/.cargo/bin/mdbook
chmod +x ~/.cargo/bin/mdbook
mkdir -p ~/.cargo/bin
- name: Build documentation
run: |
cd docs
mdbook build
- name: Test documentation examples
run: |
cd docs
mdbook test
continue-on-error: true # Don't fail CI if examples are outdated
# Check for broken links in documentation
link-check:
name: Check Links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Link Checker
uses: lycheeverse/lychee-action@v2
with:
args: >
--verbose
--no-progress
--skip-missing
--max-retries 3
--timeout 30
--exclude-path target
--exclude-path node_modules
--exclude-path .git
--exclude "https://github.com/redis-developer/redisctl/pull/.*"
--exclude "https://github.com/redis-developer/redisctl/issues/.*"
.
continue-on-error: true # Don't fail CI for broken external links
# Validate that documentation is in sync with code
doc-validation:
name: Validate Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Rust
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable
with:
toolchain: stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
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
- name: Check for TODO/FIXME in docs
run: |
echo "Checking for TODO/FIXME comments in documentation..."
! grep -r "TODO\|FIXME" docs/src --include="*.md" || echo "Found TODOs in docs"
# Status check for documentation
docs-status:
name: Documentation Status
runs-on: ubuntu-latest
needs: [markdown-lint, mdbook, link-check, doc-validation]
if: always()
steps:
- name: Documentation checks complete
run: |
echo "Documentation checks completed"
echo "Markdown lint: ${{ needs.markdown-lint.result }}"
echo "mdBook build: ${{ needs.mdbook.result }}"
echo "Link check: ${{ needs.link-check.result }}"
echo "Doc validation: ${{ needs.doc-validation.result }}"
# Only fail if mdBook build failed (critical)
if [[ "${{ needs.mdbook.result }}" != "success" ]]; then
echo "mdBook 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: [mdbook]
# Only deploy on push to main, not on PRs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache mdBook
uses: actions/cache@v4
id: mdbook-cache
with:
path: ~/.cargo/bin/mdbook
key: ${{ runner.os }}-mdbook-0.4.40
- name: Install mdBook
if: steps.mdbook-cache.outputs.cache-hit != 'true'
run: |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz
mkdir -p ~/.cargo/bin
mv mdbook ~/.cargo/bin/mdbook
chmod +x ~/.cargo/bin/mdbook
- name: Build documentation
run: cd docs && mdbook build
- name: Deploy to redisctl-docs
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
personal_token: ${{ secrets.DOCS_DEPLOY_TOKEN }}
external_repository: redis-field-engineering/redisctl-docs
publish_branch: gh-pages
publish_dir: ./docs/book
commit_message: "docs: update from redis-developer/redisctl@${{ github.sha }}"