Skip to content

Commit 2cdd018

Browse files
committed
Seperate _docs into _push_docs, add symlink
1 parent 7cdac25 commit 2cdd018

File tree

3 files changed

+33
-19
lines changed

3 files changed

+33
-19
lines changed

.github/workflows/_docs.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,3 @@ jobs:
3333
with:
3434
name: docs
3535
path: build
36-
37-
- name: Sanitize ref name for docs version
38-
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV
39-
40-
- name: Move to versioned directory
41-
run: mv build/html .github/pages/$DOCS_VERSION
42-
43-
- name: Write switcher.json
44-
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
45-
46-
- name: Publish Docs to gh-pages
47-
if: github.ref_type == 'tag' || github.ref_name == 'main'
48-
# We pin to the SHA, not the tag, for security reasons.
49-
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
50-
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
51-
with:
52-
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
publish_dir: .github/pages
54-
keep_files: true

.github/workflows/_push_docs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
workflow_call:
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Download built docs artifact
10+
uses: actions/download-artifact@v4
11+
with:
12+
name: docs
13+
path: build
14+
15+
- name: Sanitize ref name for docs version
16+
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z-1-9._-]/_}" >> $GITHUB_ENV
17+
18+
- name: Move to versioned directory
19+
run: mv build/html .github/pages/$DOCS_VERSION
20+
21+
- name: Write switcher.json
22+
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
23+
24+
- name: Publish Docs to gh-pages
25+
if: github.ref_type == 'tag' || github.ref_name == 'main'
26+
# We pin to the SHA, not the tag, for security reasons.
27+
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
28+
uses: peaceiris/actions-gh-pages@3f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
publish_dir: .github/pages
32+
keep_files: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.github/workflows/_push_docs.yml

0 commit comments

Comments
 (0)