File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Preview Docs
2+
3+ on : pull_request
4+
5+ jobs :
6+ run :
7+ runs-on : ubuntu-latest
8+ permissions : write-all
9+ steps :
10+ - name : Checkout repository
11+ uses : actions/checkout@v4
12+
13+ - name : Install Fern
14+ run : npm install -g fern-api
15+
16+ - name : Generate preview URL
17+ id : generate-docs
18+ env :
19+ FERN_TOKEN : ${{ secrets.FERN_TOKEN }}
20+ run : |
21+ OUTPUT=$(fern generate --docs --preview 2>&1) || true
22+ echo "$OUTPUT"
23+ URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()')
24+ echo "Preview URL: $URL"
25+ echo "🌿 Preview your docs: $URL" > preview_url.txt
26+
27+ - name : Comment URL in PR
28+ uses :
thollander/[email protected] 29+ with :
30+ filePath : preview_url.txt
Original file line number Diff line number Diff line change 1+ name : Publish Docs
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ run :
10+ runs-on : ubuntu-latest
11+ if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/main') && github.run_number > 1 }}
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+
16+ - name : Install Fern
17+ run : npm install -g fern-api
18+
19+ - name : Publish Docs
20+ env :
21+ FERN_TOKEN : ${{ secrets.FERN_TOKEN }}
22+ run : fern generate --docs
You can’t perform that action at this time.
0 commit comments