-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (55 loc) · 1.79 KB
/
preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: sync-and-preview-docs
on:
pull_request:
jobs:
run:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Comment Generation Update in PR
uses: thollander/actions-comment-pull-request@v2.4.3
with:
message: |
Generating preview for the latest commit ⌛
comment_tag: execution
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/requirements.txt
- name: Install yq
run: |
YQ_VERSION=v4.44.1
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O yq
chmod +x yq
mv yq /usr/local/bin
- name: Sync Docs
run: |
bash -x tools/sync-openapi.sh
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Sync OpenAPI"
commit_user_name: "GitHub Actions"
commit_user_email: "team@qdrant.com"
- name: Install Fern
run: npm install -g fern-api
- name: Generate preview URL
id: generate-docs
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: |
OUTPUT=$(fern generate --docs --preview 2>&1) || true
echo "$OUTPUT"
URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()')
echo "Preview URL: $URL"
echo "🌿 Preview your docs: $URL" > preview_url.txt
- name: Comment URL in PR
uses: thollander/actions-comment-pull-request@v2.4.3
with:
filePath: preview_url.txt
comment_tag: execution