Skip to content
Latchkey

Deploy Docs workflow (OpenEnvision/WorldFoundry)

The Deploy Docs workflow from OpenEnvision/WorldFoundry, explained and optimized by Latchkey.

A

CI health: A - excellent

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

Grade your own workflow free or run it on Latchkey →
Source: OpenEnvision/WorldFoundry.github/workflows/deploy-docs.ymlLicense Apache-2.0View source

What it does

This is the Deploy Docs workflow from the OpenEnvision/WorldFoundry repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

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

The workflow

workflow (.yml)
name: Deploy Docs

on:
  push:
    branches:
      - main
    paths:
      - ".github/workflows/deploy-docs.yml"
      - "docs/**"
      - "scripts/docs/build.sh"
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: github-pages
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      NEXT_PUBLIC_BASE_PATH: /${{ github.event.repository.name }}
      NEXT_PUBLIC_SITE_URL: https://openenvision.github.io
      NEXT_PUBLIC_DEMO_ASSET_BASE_URL: https://media.githubusercontent.com/media/${{ github.repository }}/${{ github.ref_name }}/docs/fumadocs/public

    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Set up Node
        uses: actions/setup-node@v5
        with:
          node-version: "24"
          cache: npm
          cache-dependency-path: docs/fumadocs/package-lock.json

      - name: Configure GitHub Pages
        uses: actions/configure-pages@v5
        with:
          enablement: true

      - name: Build Fumadocs site
        run: bash scripts/docs/build.sh --skip-bootstrap

      - name: Preserve Next.js assets
        run: |
          rm -rf docs/fumadocs/out/demos
          touch docs/fumadocs/out/.nojekyll

      - name: Upload GitHub Pages artifact
        uses: actions/upload-pages-artifact@v4
        with:
          path: docs/fumadocs/out

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

    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

The same workflow, on Latchkey

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

name: Deploy Docs
 
on:
  push:
    branches:
      - main
    paths:
      - ".github/workflows/deploy-docs.yml"
      - "docs/**"
      - "scripts/docs/build.sh"
  workflow_dispatch:
 
permissions:
  contents: read
  pages: write
  id-token: write
 
concurrency:
  group: github-pages
  cancel-in-progress: true
 
jobs:
  build:
    timeout-minutes: 30
    runs-on: latchkey-small
    env:
      NEXT_PUBLIC_BASE_PATH: /${{ github.event.repository.name }}
      NEXT_PUBLIC_SITE_URL: https://openenvision.github.io
      NEXT_PUBLIC_DEMO_ASSET_BASE_URL: https://media.githubusercontent.com/media/${{ github.repository }}/${{ github.ref_name }}/docs/fumadocs/public
 
    steps:
      - name: Checkout
        uses: actions/checkout@v5
 
      - name: Set up Node
        uses: actions/setup-node@v5
        with:
          node-version: "24"
          cache: npm
          cache-dependency-path: docs/fumadocs/package-lock.json
 
      - name: Configure GitHub Pages
        uses: actions/configure-pages@v5
        with:
          enablement: true
 
      - name: Build Fumadocs site
        run: bash scripts/docs/build.sh --skip-bootstrap
 
      - name: Preserve Next.js assets
        run: |
          rm -rf docs/fumadocs/out/demos
          touch docs/fumadocs/out/.nojekyll
 
      - name: Upload GitHub Pages artifact
        uses: actions/upload-pages-artifact@v4
        with:
          path: docs/fumadocs/out
 
  deploy:
    timeout-minutes: 30
    runs-on: latchkey-small
    needs: build
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
 
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4
 

What changed

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