Skip to content
Latchkey

Manual Docs Versioning workflow (Farama-Foundation/Gymnasium-Robotics)

The Manual Docs Versioning workflow from Farama-Foundation/Gymnasium-Robotics, explained and optimized by Latchkey.

B

CI health: B - good

Point runs-on at Latchkey and get caching, 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: Farama-Foundation/Gymnasium-Robotics.github/workflows/manual-build-docs-version.ymlLicense MITView source

What it does

This is the Manual Docs Versioning workflow from the Farama-Foundation/Gymnasium-Robotics 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: Manual Docs Versioning

on:
  workflow_dispatch:
    inputs:
      version:
          description: 'Documentation version to create'

          required: true

      commit:
          description: 'Commit used to build the Documentation version'

          required: false

      latest:
          description: 'Latest version'

          type: boolean


permissions:
  contents: write

jobs:
  docs:
    name: Generate Website for new version

    runs-on: ubuntu-latest

    env:
      SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    steps:
      - uses: actions/checkout@v7

        if: inputs.commit == ''


      - uses: actions/checkout@v7

        if: inputs.commit != ''

        with:
          ref: ${{ inputs.commit }}


      - uses: actions/setup-python@v6

        with:
            python-version: '3.10'


      - name: Install docs requirements

        run: pip install -r docs/requirements.txt


      - name: Install requirements and Gymnasium-Robotics

        run: pip install -e .


      - name: Build Envs Docs

        run: python docs/_scripts/gen_mds.py


      - name: Build Envs Displays

        run: python docs/_scripts/gen_envs_display.py


      - name: Build

        run: sphinx-build -b dirhtml -v docs _build


      - name: Move 404

        run: mv _build/404/index.html _build/404.html


      - name: Update 404 links

        run: python docs/_scripts/move_404.py _build/404.html


      - name: Remove .doctrees

        run: rm -r _build/.doctrees


      - name: Upload to GitHub Pages

        uses: JamesIves/github-pages-deploy-action@v4

        with:
          folder: _build

          target-folder: ${{ inputs.version }}

          clean: false


      - name: Upload to GitHub Pages

        uses: JamesIves/github-pages-deploy-action@v4

        if: inputs.latest

        with:
          folder: _build

          clean-exclude: |

            *.*.*/

            main

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: Manual Docs Versioning

on:

  workflow_dispatch:

    inputs:

      version:

          description: 'Documentation version to create'

          required: true

      commit:

          description: 'Commit used to build the Documentation version'

          required: false

      latest:

          description: 'Latest version'

          type: boolean



permissions:

  contents: write

jobs:

  docs:

    name: Generate Website for new version

    runs-on: latchkey-small

    env:

      SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    steps:

      - uses: actions/checkout@v7

        if: inputs.commit == ''



      - uses: actions/checkout@v7

        if: inputs.commit != ''

        with:

          ref: ${{ inputs.commit }}



      - uses: actions/setup-python@v6

        with:

          cache: 'pip'

            python-version: '3.10'



      - name: Install docs requirements

        run: pip install -r docs/requirements.txt



      - name: Install requirements and Gymnasium-Robotics

        run: pip install -e .



      - name: Build Envs Docs

        run: python docs/_scripts/gen_mds.py



      - name: Build Envs Displays

        run: python docs/_scripts/gen_envs_display.py



      - name: Build

        run: sphinx-build -b dirhtml -v docs _build



      - name: Move 404

        run: mv _build/404/index.html _build/404.html



      - name: Update 404 links

        run: python docs/_scripts/move_404.py _build/404.html



      - name: Remove .doctrees

        run: rm -r _build/.doctrees



      - name: Upload to GitHub Pages

        uses: JamesIves/github-pages-deploy-action@v4

        with:

          folder: _build

          target-folder: ${{ inputs.version }}

          clean: false



      - name: Upload to GitHub Pages

        uses: JamesIves/github-pages-deploy-action@v4

        if: inputs.latest

        with:

          folder: _build

          clean-exclude: |

            *.*.*/

            main

 

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.

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