@@ -29,11 +29,21 @@ jobs:
29
29
cd docs/
30
30
conda install -c conda-forge --file requirements.txt
31
31
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
34
41
run : |
42
+ git checkout candidate/stable
35
43
cd docs/
36
44
mkdocs build
45
+ mkdir -p ../gh-pages/stable
46
+ cp -R site/* ../gh-pages/stable
37
47
38
48
- name : Create Redirect Index
39
49
run : |
45
55
<body>
46
56
<p>Redirecting to the latest beta documentation...</p>
47
57
</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
78
59
79
60
- name : Deploy to GitHub Pages
80
61
uses : peaceiris/actions-gh-pages@v3
0 commit comments