Skip to content

Commit 6e3cad1

Browse files
committed
ci: add docs-release-* tag workflow to publish docs at release
Docs deploy from the docs-live branch via Mintlify, so a push to main no longer publishes on its own. This workflow publishes at release: push a docs-release-* tag at the commit you want live, and it runs the Mintlify broken-links check against that commit, then fast-forwards docs-live to it. The ref update uses force=false, so it is fast-forward only: a tag that is not ahead of docs-live fails the job instead of rewinding production.
1 parent 3b91999 commit 6e3cad1

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/publish-docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 📚 Publish docs
2+
3+
on:
4+
push:
5+
tags:
6+
- "docs-release-*"
7+
8+
# Only needs to move the docs-live ref; Mintlify's GitHub app deploys from it.
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: publish-docs
14+
cancel-in-progress: false
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: 📥 Checkout tagged commit
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
25+
- name: 📦 Cache npm
26+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
27+
with:
28+
path: |
29+
~/.npm
30+
key: |
31+
${{ runner.os }}-mintlify
32+
restore-keys: |
33+
${{ runner.os }}-mintlify
34+
35+
- name: 🔗 Check for broken links
36+
working-directory: ./docs
37+
run: npx mintlify@4.0.393 broken-links
38+
39+
- name: 🚀 Fast-forward docs-live to the tagged commit
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
gh api -X PATCH \
44+
"repos/${{ github.repository }}/git/refs/heads/docs-live" \
45+
-f sha="${{ github.sha }}" \
46+
-F force=false

0 commit comments

Comments
 (0)