Skip to content

Commit e4ae1f0

Browse files
committedNov 18, 2024
(workflow): instead build beta and stable docs on any trigger
1 parent 3de2f55 commit e4ae1f0

File tree

1 file changed

+13
-32
lines changed

1 file changed

+13
-32
lines changed
 

‎.github/workflows/deploy-mkdocs.yml

+13-32
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ jobs:
2929
cd docs/
3030
conda install -c conda-forge --file requirements.txt
3131
32-
- name: Build site
33-
shell: bash -l {0}
32+
- name: Build Beta Docs
33+
run: |
34+
git checkout beta
35+
cd docs/
36+
mkdocs build
37+
mkdir -p ../gh-pages/beta
38+
cp -R site/* ../gh-pages/beta
39+
40+
- name: Build Stable Docs
3441
run: |
42+
git checkout candidate/stable
3543
cd docs/
3644
mkdocs build
45+
mkdir -p ../gh-pages/stable
46+
cp -R site/* ../gh-pages/stable
3747
3848
- name: Create Redirect Index
3949
run: |
@@ -45,36 +55,7 @@ jobs:
4555
<body>
4656
<p>Redirecting to the latest beta documentation...</p>
4757
</body>
48-
</html>' > ./docs/site/index.html
49-
50-
- name: Determine Deployment Directory
51-
id: branch
52-
run: |
53-
if [[ "${GITHUB_REF_NAME}" == "beta" ]]; then
54-
echo "DEPLOY_DIR=beta" >> $GITHUB_ENV
55-
elif [[ "${GITHUB_REF_NAME}" == "candidate/stable" ]]; then
56-
echo "DEPLOY_DIR=candidate" >> $GITHUB_ENV
57-
elif [[ "${GITHUB_REF_NAME}" == "testdocs" ]]; then
58-
echo "DEPLOY_DIR=test" >> $GITHUB_ENV
59-
else
60-
echo "Unknown branch: ${GITHUB_REF_NAME}" && exit 1
61-
fi
62-
63-
- name: Prepare Deployment Directory
64-
run: |
65-
mkdir -p ./gh-pages/${{ env.DEPLOY_DIR }}
66-
cp -R ./docs/site/* ./gh-pages/${{ env.DEPLOY_DIR }}
67-
if [[ "${GITHUB_REF_NAME}" == "beta" ]]; then
68-
echo '<!DOCTYPE html>
69-
<html>
70-
<head>
71-
<meta http-equiv="refresh" content="0; url=beta/" />
72-
</head>
73-
<body>
74-
<p>Redirecting to the latest beta documentation...</p>
75-
</body>
76-
</html>' > ./gh-pages/index.html
77-
fi
58+
</html>' > ./gh-pages/index.html
7859
7960
- name: Deploy to GitHub Pages
8061
uses: peaceiris/actions-gh-pages@v3

0 commit comments

Comments
 (0)