Skip to content

Commit 767d499

Browse files
authored
Chore CI workflows for docs and convert docs to group instead of extra (#543)
1 parent 64a7542 commit 767d499

File tree

3 files changed

+29
-45
lines changed

3 files changed

+29
-45
lines changed
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
pull_request:
55
branches: [main, develop]
66
push:
7-
branches: [docs/wip]
7+
branches: [main, develop]
8+
workflow_dispatch: {}
89

910
# Restrict permissions by default
1011
permissions:
@@ -16,26 +17,20 @@ jobs:
1617
name: Test docs build
1718
runs-on: ubuntu-latest
1819
timeout-minutes: 10
19-
strategy:
20-
matrix:
21-
python-version: ["3.10"]
2220
steps:
2321
- name: 📥 Checkout the repository
2422
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2523
with:
2624
fetch-depth: 0
2725

28-
- name: 🐍 Install uv and set Python ${{ matrix.python-version }}
29-
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
26+
- name: 🐍 Install uv and set Python
27+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
3028
with:
31-
python-version: ${{ matrix.python-version }}
29+
python-version: "3.10"
3230
activate-environment: true
3331

34-
3532
- name: 🏗️ Install dependencies
36-
run: |
37-
uv pip install -r pyproject.toml --extra docs
38-
33+
run: uv pip install -r pyproject.toml --group docs
3934

4035
- name: 🧪 Test Docs Build
4136
run: uv run mkdocs build --verbose

.github/workflows/publish-docs.yml

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Build and Publish Docs
22

33
on:
44
push:
5-
branches:
6-
- develop
7-
workflow_dispatch:
5+
branches: [main, develop]
6+
workflow_dispatch: {}
87
release:
98
types: [published]
109

@@ -27,48 +26,36 @@ jobs:
2726
name: documentation-deployment
2827
url: https://rfdetr.roboflow.com/
2928
timeout-minutes: 10
30-
strategy:
31-
matrix:
32-
python-version: ["3.10"]
3329
steps:
3430
- name: 📥 Checkout the repository
3531
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3632
with:
3733
fetch-depth: 0
3834

39-
- name: 🐍 Install uv and set Python ${{ matrix.python-version }}
40-
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
35+
- name: 🐍 Install uv and set Python
36+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
4137
with:
42-
python-version: ${{ matrix.python-version }}
43-
44-
- name: 🔑 Create GitHub App token (mkdocs)
45-
id: mkdocs_token
46-
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
47-
with:
48-
app-id: ${{ secrets.MKDOCS_APP_ID }}
49-
private-key: ${{ secrets.MKDOCS_PEM }}
50-
owner: roboflow
51-
repositories: mkdocs-material-insiders
38+
python-version: "3.10"
39+
activate-environment: true
5240

5341
- name: 🏗️ Install dependencies
54-
run: |
55-
uv pip install -r pyproject.toml --extra docs
56-
uv pip install -e ".[docs]"
57-
# Install mkdocs-material-insiders using the GitHub App token
58-
uv pip install "git+https://roboflow:${{ steps.mkdocs_token.outputs.token }}@github.com/roboflow/[email protected]#egg=mkdocs-material[imaging]"
42+
run: uv sync --group docs
5943

6044
- name: ⚙️ Configure git for github-actions
6145
run: |
62-
git config --global user.name "github-actions[bot]"
63-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
46+
git config --global user.name "${{ github.actor }}"
47+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
6448
6549
- name: 🚀 Deploy Development Docs
6650
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') || github.event_name == 'workflow_dispatch'
67-
run: |
68-
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} uv run mike deploy --push develop
51+
env:
52+
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
53+
run: uv run mike deploy --push develop
6954

7055
- name: 🚀 Deploy Release Docs
7156
if: github.event_name == 'release' && github.event.action == 'published'
57+
env:
58+
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
7259
run: |
7360
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
74-
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} uv run mike deploy --push --update-aliases $latest_tag latest
61+
uv run mike deploy --push --update-aliases $latest_tag latest

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,22 @@ metrics = [
7272
"tensorboard>=2.13.0",
7373
"wandb"
7474
]
75+
build = [
76+
"twine>=5.1.1",
77+
"wheel>=0.40",
78+
"build>=0.10"
79+
]
80+
81+
[dependency-groups]
7582
docs = [
76-
"mkdocs-material[imaging]>=9.5.5",
83+
"mkdocs-material[imaging]>=9.7",
7784
"mkdocstrings>=0.25.2,<0.30.0",
7885
"mkdocstrings-python>=1.10.9",
7986
"mike>=2.0.0",
8087
"mkdocs-jupyter>=0.24.3",
8188
"mkdocs-git-committers-plugin-2>=2.4.1; python_version >= '3.8' and python_version < '4'",
8289
"mkdocs-git-revision-date-localized-plugin>=1.2.4"
8390
]
84-
build = [
85-
"twine>=5.1.1",
86-
"wheel>=0.40",
87-
"build>=0.10"
88-
]
8991

9092
[project.urls]
9193
Homepage = "https://github.com/roboflow/rf-detr"

0 commit comments

Comments
 (0)