Skip to content

Commit 35fc37b

Browse files
authored
fix: deploy docs after releases (#68)
* fix: run docs deploy on releases - Trigger docs deploy on release published and manual dispatch - Resolve registry version from release tag or manual input - Require workflow_dispatch version to prevent 0.0.0-dev deployments * fix: skip docs deploy on prereleases
1 parent fd51016 commit 35fc37b

1 file changed

Lines changed: 37 additions & 11 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
name: Docs
22

33
on:
4-
push:
5-
branches: [main]
6-
paths:
7-
- 'docs/**'
8-
- 'skills/**'
9-
- 'agents/**'
10-
- 'commands/**'
11-
- 'registry/**'
12-
- 'scripts/build-registry.ts'
13-
- 'README.md'
4+
release:
5+
types: [published]
146
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Release version (optional, semver or v-prefixed)
10+
required: false
11+
type: string
1512

1613
concurrency:
1714
group: docs-deploy
@@ -24,6 +21,7 @@ jobs:
2421
build-and-deploy:
2522
name: Build and Deploy Docs
2623
runs-on: ubuntu-latest
24+
if: ${{ github.event_name != 'release' || !github.event.release.prerelease }}
2725
steps:
2826
- name: Checkout
2927
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -39,8 +37,36 @@ jobs:
3937
- name: Generate reference content
4038
run: bun run docs:generate
4139

40+
- name: Resolve registry version
41+
id: registry-version
42+
env:
43+
EVENT_NAME: ${{ github.event_name }}
44+
RELEASE_TAG: ${{ github.event.release.tag_name }}
45+
INPUT_VERSION: ${{ github.event.inputs.version }}
46+
run: |
47+
if [ "$EVENT_NAME" = "release" ]; then
48+
version="$RELEASE_TAG"
49+
version="${version#v}"
50+
echo "version=${version}" >> "$GITHUB_OUTPUT"
51+
exit 0
52+
fi
53+
54+
if [ -n "$INPUT_VERSION" ]; then
55+
version="$INPUT_VERSION"
56+
version="${version#v}"
57+
echo "version=${version}" >> "$GITHUB_OUTPUT"
58+
exit 0
59+
fi
60+
61+
echo "version=" >> "$GITHUB_OUTPUT"
62+
4263
- name: Build registry
43-
run: bun scripts/build-registry.ts
64+
run: |
65+
if [ -n "${{ steps.registry-version.outputs.version }}" ]; then
66+
bun scripts/build-registry.ts --version "${{ steps.registry-version.outputs.version }}"
67+
else
68+
bun scripts/build-registry.ts
69+
fi
4470
4571
- name: Build docs
4672
run: bun run --cwd docs build

0 commit comments

Comments
 (0)