Skip to content
Latchkey

Release docs workflow (ultimate-notion/ultimate-notion)

The Release docs workflow from ultimate-notion/ultimate-notion, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get caching, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: ultimate-notion/ultimate-notion.github/workflows/build-rel-docs.ymlLicense MITView source

What it does

This is the Release docs workflow from the ultimate-notion/ultimate-notion 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: Release docs

on:
  push:
    tags:
    - v*

  workflow_dispatch:

concurrency:
  group: rel-docs-deploy
  cancel-in-progress: true

env:
  FORCE_COLOR: "1"

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v6
      with:
        # Fetch all history for applying timestamps to every page
        fetch-depth: 0

    - name: Set up Python
      uses: actions/setup-python@v6
      with:
        python-version: '3.10'

    - name: Setup environment requirements
      uses: ./.github/actions/setup-venv-reqs

    - name: Set the version of docs to publish
      run: hatch run docs:python docs/scripts/set_release_version.py

    - name: Configure Git for GitHub Actions bot
      run: |
        git config --local user.name 'github-actions[bot]'
        git config --local user.email 'github-actions[bot]@users.noreply.github.com'

    - name: Build documentation
      run: hatch run docs:build-check

    - name: Commit documentation on gh-pages
      run: hatch run docs:ci-build $ULTIMATE_NOTION_VERSION latest

    - name: Create archive
      run: git archive -o site.zip gh-pages

    - uses: actions/upload-artifact@v7
      with:
        name: docs
        path: site.zip


  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest

    needs:
    - build

    steps:
    - name: Download archive
      uses: actions/download-artifact@v8
      with:
        name: docs

    - name: Unpack archive
      run: python -m zipfile -e site.zip site

    - uses: peaceiris/actions-gh-pages@v4
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: site
        commit_message: ${{ github.event.head_commit.message }}
        # Write .nojekyll at the root, see:
        # https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
        enable_jekyll: false
        # Only deploy if there were changes
        allow_empty_commit: false

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Release docs
 
on:
  push:
    tags:
    - v*
 
  workflow_dispatch:
 
concurrency:
  group: rel-docs-deploy
  cancel-in-progress: true
 
env:
  FORCE_COLOR: "1"
 
jobs:
  build:
    timeout-minutes: 30
    runs-on: latchkey-small
 
    steps:
    - uses: actions/checkout@v6
      with:
        # Fetch all history for applying timestamps to every page
        fetch-depth: 0
 
    - name: Set up Python
      uses: actions/setup-python@v6
      with:
        cache: 'pip'
        python-version: '3.10'
 
    - name: Setup environment requirements
      uses: ./.github/actions/setup-venv-reqs
 
    - name: Set the version of docs to publish
      run: hatch run docs:python docs/scripts/set_release_version.py
 
    - name: Configure Git for GitHub Actions bot
      run: |
        git config --local user.name 'github-actions[bot]'
        git config --local user.email 'github-actions[bot]@users.noreply.github.com'
 
    - name: Build documentation
      run: hatch run docs:build-check
 
    - name: Commit documentation on gh-pages
      run: hatch run docs:ci-build $ULTIMATE_NOTION_VERSION latest
 
    - name: Create archive
      run: git archive -o site.zip gh-pages
 
    - uses: actions/upload-artifact@v7
      with:
        name: docs
        path: site.zip
 
 
  deploy:
    timeout-minutes: 30
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: latchkey-small
 
    needs:
    - build
 
    steps:
    - name: Download archive
      uses: actions/download-artifact@v8
      with:
        name: docs
 
    - name: Unpack archive
      run: python -m zipfile -e site.zip site
 
    - uses: peaceiris/actions-gh-pages@v4
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: site
        commit_message: ${{ github.event.head_commit.message }}
        # Write .nojekyll at the root, see:
        # https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
        enable_jekyll: false
        # Only deploy if there were changes
        allow_empty_commit: false
 

What changed

1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

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

Actions used in this workflow