Update documentation after merge workflow (codeceptjs/CodeceptJS)
The Update documentation after merge workflow from codeceptjs/CodeceptJS, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get caching, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Update documentation after merge workflow from the codeceptjs/CodeceptJS 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
name: Update documentation after merge
on:
push:
branches:
- 4.x
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update-documentation:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20.x]
steps:
- name: Check out the repo
uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm i --force
- name: Configure git user
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Update contributor faces
run: |
npm run update-contributor-faces
git add README.md
if ! git diff --cached --quiet; then
git commit -m "DOC: Update contributor faces" --no-verify
fi
- name: Generate and update documentation
run: |
npm run def && npm run docs
git add docs/**/*.md
if ! git diff --cached --quiet; then
git commit -m "DOC: Autogenerate and update documentation" --no-verify
fi
- name: Push to the repo
run: git push --no-verify
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: Update documentation after merge on: push: branches: - 4.x concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: update-documentation: timeout-minutes: 30 runs-on: latchkey-small strategy: matrix: node-version: [20.x] steps: - name: Check out the repo uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: cache: 'npm' node-version: ${{ matrix.node-version }} - name: Install Dependencies run: npm i --force - name: Configure git user run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - name: Update contributor faces run: | npm run update-contributor-faces git add README.md if ! git diff --cached --quiet; then git commit -m "DOC: Update contributor faces" --no-verify fi - name: Generate and update documentation run: | npm run def && npm run docs git add docs/**/*.md if ! git diff --cached --quiet; then git commit -m "DOC: Autogenerate and update documentation" --no-verify fi - name: Push to the repo run: git push --no-verify
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.