6
6
push :
7
7
branches :
8
8
- main
9
- - staging
9
+
10
+ pull_request :
11
+ branches :
12
+ - main
10
13
11
14
# Allows you to run this workflow manually from the Actions tab
12
15
workflow_dispatch :
@@ -17,38 +20,71 @@ permissions:
17
20
pages : write
18
21
id-token : write
19
22
20
- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21
- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22
23
concurrency :
23
- group : " pages "
24
- cancel-in-progress : false
24
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25
+ cancel-in-progress : true
25
26
26
27
jobs :
27
28
build-04 :
28
29
runs-on : ubuntu-latest
30
+ strategy :
31
+ matrix :
32
+ version :
33
+ [
34
+ { ref: main, dest-dir: dev },
35
+ { ref: "v0.4.0.dev0", dest-dir: "0.4.0.dev0" },
36
+ { ref: "v0.4.0.dev1", dest-dir: "0.4.0.dev1" },
37
+ { ref: "v0.4.0.dev2", dest-dir: "0.4.0.dev2" },
38
+ { ref: "v0.4.0.dev3", dest-dir: "0.4.0.dev3" },
39
+ { ref: "v0.4.0.dev4", dest-dir: "0.4.0.dev4" },
40
+ { ref: "v0.4.0.dev5", dest-dir: "0.4.0.dev5" },
41
+ { ref: "v0.4.0.dev6", dest-dir: "0.4.0.dev6" },
42
+ ]
29
43
steps :
30
44
- name : Checkout
31
45
uses : actions/checkout@v4
32
46
with :
33
- lfs : ' true'
34
- - run : curl -LsSf https://astral.sh/uv/install.sh | sh
47
+ lfs : " true"
48
+ ref : ${{ matrix.version.ref }}
49
+ - uses : astral-sh/setup-uv@v3
50
+ with :
51
+ enable-cache : true
35
52
- uses : actions/setup-python@v5
36
53
with :
37
- python-version : ' 3.11'
54
+ python-version : " 3.11"
38
55
- run : |
39
56
uv sync --locked --all-extras
40
57
source .venv/bin/activate
41
58
poe --directory ./packages/autogen-core docs-build
42
- mkdir -p docs-staging/dev /
43
- mv ./packages/autogen-core/docs/build/* docs-staging/dev /
59
+ mkdir -p docs-staging/${{ matrix.version.dest-dir }} /
60
+ mv ./packages/autogen-core/docs/build/* docs-staging/${{ matrix.version.dest-dir }} /
44
61
working-directory: ./python
62
+ env:
63
+ PY_DOCS_DIR: ${{ matrix.version.dest-dir }}/
64
+ PY_SWITCHER_VERSION: ${{ matrix.version.dest-dir }}
65
+ - uses : actions/upload-artifact@v4
66
+ with :
67
+ path : " ./python/docs-staging"
68
+ name : " ${{ matrix.version.dest-dir }}-docs"
69
+
70
+ gen-redirects :
71
+ runs-on : ubuntu-latest
72
+ steps :
73
+ - name : Checkout
74
+ uses : actions/checkout@v4
75
+ with :
76
+ lfs : " true"
77
+ - uses : actions/setup-python@v5
78
+ with :
79
+ python-version : " 3.11"
45
80
- name : generate redirects
46
81
run : |
82
+ mkdir -p python/docs-staging/
47
83
python python/packages/autogen-core/docs/redirects/redirects.py python/docs-staging
48
84
- uses : actions/upload-artifact@v4
49
85
with :
50
86
path : " ./python/docs-staging"
51
- name : " 04-docs "
87
+ name : " redirects "
52
88
53
89
build-02 :
54
90
runs-on : ubuntu-latest
@@ -112,8 +148,8 @@ jobs:
112
148
name : github-pages
113
149
url : ${{ steps.deployment.outputs.page_url }}
114
150
runs-on : ubuntu-latest
115
- needs : [build-02, build-04]
116
- if : ${{ needs.build-02.result == 'success' && needs.build-04.result == 'success' && github.ref == 'refs/heads/main' }}
151
+ needs : [build-02, build-04, gen-redirects ]
152
+ if : ${{ needs.build-02.result == 'success' && needs.build-04.result == 'success' && needs.gen-redirects.result == 'success' && github.ref == 'refs/heads/main' }}
117
153
steps :
118
154
- uses : actions/download-artifact@v4
119
155
with :
@@ -122,8 +158,9 @@ jobs:
122
158
- name : Copy 02-docs
123
159
run : |
124
160
mkdir -p deploy/
125
- cp -r artifacts/02-docs/* deploy/
126
- cp -r artifacts/04-docs/* deploy/
161
+ for dir in artifacts/*; do
162
+ cp -r $dir/* deploy/
163
+ done
127
164
128
165
- name : Upload artifact
129
166
uses : actions/upload-pages-artifact@v3
0 commit comments