Notify docs site of release workflow (MotleyAI/slayer)
The Notify docs site of release workflow from MotleyAI/slayer, 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.
What it does
This is the Notify docs site of release workflow from the MotleyAI/slayer 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: Notify docs site of release
# When a GitHub Release is published, tell the combined product-docs site
# (MotleyAI/motley-docs) to pull this release's docs + navigation and
# republish https://docs.motley.ai/slayer.
#
on:
release:
types: [published]
# Allow re-triggering a sync by hand (e.g. after fixing the docs repo).
workflow_dispatch:
inputs:
ref:
description: "SLayer git ref to sync (tag/branch)"
required: true
default: main
jobs:
notify:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Mint installation token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.MOTLEY_DOCS_APP_ID }}
private-key: ${{ secrets.MOTLEY_DOCS_APP_PRIVATE_KEY }}
owner: MotleyAI
repositories: motley-docs
permission-contents: write
permission-metadata: read
- name: Trigger motley-docs sync
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
with:
token: ${{ steps.app-token.outputs.token }}
repository: MotleyAI/motley-docs
event-type: slayer-release
client-payload: |
{"ref": "${{ github.event.release.tag_name || inputs.ref }}"}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Notify docs site of release # When a GitHub Release is published, tell the combined product-docs site # (MotleyAI/motley-docs) to pull this release's docs + navigation and # republish https://docs.motley.ai/slayer. # on: release: types: [published] # Allow re-triggering a sync by hand (e.g. after fixing the docs repo). workflow_dispatch: inputs: ref: description: "SLayer git ref to sync (tag/branch)" required: true default: main jobs: notify: timeout-minutes: 30 runs-on: latchkey-small permissions: contents: read steps: - name: Mint installation token id: app-token uses: actions/create-github-app-token@v2 with: app-id: ${{ vars.MOTLEY_DOCS_APP_ID }} private-key: ${{ secrets.MOTLEY_DOCS_APP_PRIVATE_KEY }} owner: MotleyAI repositories: motley-docs permission-contents: write permission-metadata: read - name: Trigger motley-docs sync uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3 with: token: ${{ steps.app-token.outputs.token }} repository: MotleyAI/motley-docs event-type: slayer-release client-payload: | {"ref": "${{ github.event.release.tag_name || inputs.ref }}"}
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. - 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.