Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
feat: added github actions for fern (#1620)
Siddharth Balyan committed
Jun 11, 2025 at 07:40 UTC
d16bf708d576f5f36946cc72fdd7a9262ec05c40
2 files changed
+122
.github/workflows/preview_docs.yml
new
+68
@@ -0,0 +1,68 @@
1
+name: Preview Docs
2
+
3
+on:
4
+ pull_request:
5
+ paths:
6
+ - 'fern/**'
7
+
8
+jobs:
9
+ run:
10
+ runs-on: ubuntu-latest
11
+ permissions: write-all
12
+ defaults:
13
+ run:
14
+ working-directory: ./fern
15
+ env:
16
+ COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}
17
+
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v5
24
+
25
+ - name: Install pnpm
26
+ uses: pnpm/action-setup@v4
27
+ with:
28
+ version: latest
29
+
30
+ - name: Install local dependencies
31
+ run: pnpm install
32
+
33
+ - name: Set up Python
34
+ run: uv python install
35
+
36
+ - name: Install Python Dependencies
37
+ run: |
38
+ uv sync
39
+ uv run composio apps generate-types
40
+
41
+ - name: Generate Tool Documentation
42
+ run: pnpm tools:generate
43
+
44
+ - name: Generate SDK Reference
45
+ run: pnpm sdkdocs
46
+
47
+ - name: Install Fern
48
+ run: npm install -g fern-api
49
+
50
+ - name: Pull Latest OpenAPI Specification
51
+ run: pnpm api:pull
52
+
53
+ - name: Generate preview URL
54
+ id: generate-docs
55
+ env:
56
+ FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
57
+ POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
58
+ run: |
59
+ OUTPUT=$(fern generate --docs --preview 2>&1) || true
60
+ echo "$OUTPUT"
61
+ URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()')
62
+ echo "Preview URL: $URL"
63
+ echo "🌿 Preview your docs: $URL" > preview_url.txt
64
+
65
+ - name: Comment URL in PR
66
+ uses: thollander/actions-comment-pull-request@v2.4.3
67
+ with:
68
+ filePath: fern/preview_url.txt
.github/workflows/publish_docs.yml
new
+54
@@ -0,0 +1,54 @@
1
+name: Publish Docs
2
+
3
+on:
4
+ push:
5
+ branches:
6
+ - next
7
+
8
+jobs:
9
+ run:
10
+ runs-on: ubuntu-latest
11
+ if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/next') && github.run_number > 1 }}
12
+ defaults:
13
+ run:
14
+ working-directory: ./fern
15
+ env:
16
+ COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Install pnpm
25
+ uses: pnpm/action-setup@v4
26
+ with:
27
+ version: latest
28
+
29
+ - name: Install local dependencies
30
+ run: pnpm install
31
+
32
+ - name: Set up Python
33
+ run: uv python install
34
+
35
+ - name: Install Python Dependencies
36
+ run: |
37
+ uv sync
38
+ uv run composio apps generate-types
39
+
40
+ - name: Generate Tool Documentation
41
+ run: pnpm tools:generate
42
+
43
+ - name: Generate SDK Reference
44
+ run: pnpm sdkdocs
45
+
46
+ - name: Pull Latest OpenAPI Specification
47
+ run: pnpm api:pull
48
+
49
+ - name: Publish Docs
50
+ env:
51
+ POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
52
+ FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
53
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54
+ run: fern generate --docs