Skip to content

Commit f05e837

Browse files
committed
Feat: Add new workflow for publish docs
1 parent 824c4ee commit f05e837

File tree

2 files changed

+62
-49
lines changed

2 files changed

+62
-49
lines changed

.github/workflows/publish-docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: publish docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v3.*
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test-docs:
15+
name: test-docs
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: stable
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: latest
29+
30+
- name: Set PATH
31+
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
32+
33+
- run: make ensure-gfmrun
34+
35+
- run: make gfmrun
36+
env:
37+
FLAGS: --walk docs/v3/
38+
39+
- run: make diffcheck
40+
41+
publish:
42+
permissions:
43+
contents: write
44+
if: startswith(github.ref, 'refs/tags/')
45+
name: publish
46+
needs: [test-docs]
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
53+
- run: make ensure-mkdocs
54+
env:
55+
FLAGS: --upgrade-pip
56+
57+
- run: make set-mkdocs-remote
58+
env:
59+
MKDOCS_REMOTE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- run: make deploy-mkdocs
62+

.github/workflows/test.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -58,52 +58,3 @@ jobs:
5858
token: ${{ secrets.CODECOV_TOKEN }}
5959
fail_ci_if_error: true
6060
verbose: true
61-
62-
test-docs:
63-
name: test-docs
64-
runs-on: ubuntu-latest
65-
steps:
66-
- uses: actions/checkout@v4
67-
68-
- name: Set up Go
69-
uses: actions/setup-go@v5
70-
with:
71-
go-version: stable
72-
73-
- name: Set up Node.js
74-
uses: actions/setup-node@v4
75-
with:
76-
node-version: latest
77-
78-
- name: Set PATH
79-
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
80-
81-
- run: make ensure-gfmrun
82-
83-
- run: make gfmrun
84-
env:
85-
FLAGS: --walk docs/v3/
86-
87-
- run: make diffcheck
88-
89-
publish:
90-
permissions:
91-
contents: write
92-
if: startswith(github.ref, 'refs/tags/')
93-
name: publish
94-
needs: [test-docs]
95-
runs-on: ubuntu-latest
96-
steps:
97-
- uses: actions/checkout@v4
98-
with:
99-
fetch-depth: 0
100-
101-
- run: make ensure-mkdocs
102-
env:
103-
FLAGS: --upgrade-pip
104-
105-
- run: make set-mkdocs-remote
106-
env:
107-
MKDOCS_REMOTE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108-
109-
- run: make deploy-mkdocs

0 commit comments

Comments
 (0)