Repository navigation
95 lines (82 loc) · 3.09 KB
/
Copy pathdocs.yml
File metadata and controls
95 lines (82 loc) · 3.09 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
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Docs
on:
workflow_dispatch:
push:
branches: [main]
paths: &docs-paths
- "torch_tweak/**"
- "docs/**"
- "examples/**/README.md"
- "scripts/stage_docs.py"
- "properdocs.yml"
- "ChangeLog.md"
- "LICENSE"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/docs.yml"
pull_request:
paths: *docs-paths
concurrency:
group: >-
${{ github.workflow }}-${{ github.event_name }}-
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# TODO: Change back to "3.x" once openvino releases 3.15 version
# ref. https://github.com/openvinotoolkit/openvino/issues/38721
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
- name: Set up uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
- name: Install doc dependencies
run: uv sync --no-default-groups --extra doc
- name: Build docs
run: uv run --no-default-groups --extra doc properdocs build --strict
# Deploys with mike instead of actions/deploy-pages to keep versioned docs (one
# directory per version on the gh-pages branch, with a version selector).
# mike pushes to gh-pages, so this job needs contents: write.
deploy-docs:
name: Deploy docs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build-docs
permissions:
contents: write
# The workflow-level group is per event and ref, so runs for different refs can
# deploy at the same time, e.g. a release pushes main and a tag together. This
# shared group queues all deploys, so two mike pushes to gh-pages never race,
# and a running deploy is not cancelled by a queued one. A newer push to the
# same ref still cancels the whole older run.
concurrency:
group: docs-deploy
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
# TODO: Change back to "3.x" once openvino releases 3.15 version
# ref. https://github.com/openvinotoolkit/openvino/issues/38721
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
- name: Set up uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
- name: Install doc dependencies
run: uv sync --no-default-groups --extra doc
- name: Deploy docs
env:
GIT_COMMITTER_NAME: ${{ secrets.GH_BB_DOCKER_USERNAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GH_BB_DOCKER_USERNAME }}@users.noreply.github.com
run: uv run --no-default-groups --extra doc mike deploy --push main