Skip to content

docs: Go Snippets

docs: Go Snippets #100

Workflow file for this run

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