Repository navigation
82 lines (66 loc) · 2.12 KB
/
Copy pathdeploy-all-docs.yml
File metadata and controls
82 lines (66 loc) · 2.12 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Deploy All Docs
on:
workflow_dispatch: # Manual trigger
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if running on blocked branch
if: |
github.ref == 'refs/heads/develop'
run: |
echo "This workflow cannot be run on develop branch. If you want to deploy docs, run it on the latest release branch"
exit 1
deploy-dokka-docs:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
BRANCH_KOOG_IS_RELEASING_FROM: ${{ github.ref_name }}
steps:
- name: Checkout project
uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Build Dokka docs
run: ./gradlew dokkaGenerate
- name: Debug listing build folder
run: ls -R build
- name: Push to docs repo
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
cd build/dokka/html
echo "api.koog.ai" > CNAME
git init
git remote add origin https://x-access-token:${{ secrets.DOCS_DEPLOY_TOKEN }}@github.com/JetBrains/koog-api-docs.git
git checkout -b main
git add .
git commit -m "Update docs"
git push --force origin main
deploy-gh-pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Configure Git
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v6
# Using setup-python on CI to install Python might be faster than with uv (official uv recommendation)
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "./docs/.python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.15"
enable-cache: true
- name: Deploy docs
working-directory: ./docs
run: |
uv sync --frozen --all-extras
uv run mkdocs gh-deploy --force