Skip to content
Latchkey

Build Documentation workflow (ekzhu/datasketch)

The Build Documentation workflow from ekzhu/datasketch, explained and optimized by Latchkey.

C

CI health: C - fair

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: ekzhu/datasketch.github/workflows/doc.ymlLicense MITView source

What it does

This is the Build Documentation workflow from the ekzhu/datasketch repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Build Documentation

# Triggers the workflow on push or pull request events
on: [push, pull_request]

permissions:
  contents: write

jobs:
  build:
    runs-on: "ubuntu-latest"
    steps:
      - uses: actions/checkout@v7
      - name: Install uv and setup Python
        uses: astral-sh/setup-uv@v7
        with:
          activate-environment: true
          python-version: "3.10"
          enable-cache: true
      - name: Install package with dependencies
        run: |
          # Disable Cassandra optional extensions (faster testing).
          export CASS_DRIVER_NO_EXTENSIONS=1
          uv sync --extra bloom
          uv pip install sphinx sphinx-rtd-theme
      - name: Compile documentation
        run: |
          cd docs
          make html
      - name: Deploy to GitHub pages
        if: ${{ github.ref == 'refs/heads/master' }}
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          BRANCH: gh-pages
          FOLDER: docs/_build/html
          CLEAN: true
      - name: Minimize uv cache
        run: uv cache prune --ci

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Build Documentation
 
# Triggers the workflow on push or pull request events
on: [push, pull_request]
 
permissions:
  contents: write
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    steps:
      - uses: actions/checkout@v7
      - name: Install uv and setup Python
        uses: astral-sh/setup-uv@v7
        with:
          activate-environment: true
          python-version: "3.10"
          enable-cache: true
      - name: Install package with dependencies
        run: |
          # Disable Cassandra optional extensions (faster testing).
          export CASS_DRIVER_NO_EXTENSIONS=1
          uv sync --extra bloom
          uv pip install sphinx sphinx-rtd-theme
      - name: Compile documentation
        run: |
          cd docs
          make html
      - name: Deploy to GitHub pages
        if: ${{ github.ref == 'refs/heads/master' }}
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          BRANCH: gh-pages
          FOLDER: docs/_build/html
          CLEAN: true
      - name: Minimize uv cache
        run: uv cache prune --ci
 

What changed

2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow