Skip to content

Commit

Permalink
Merge pull request #106 from aboutcircles/20241118-docs-update-beta
Browse files Browse the repository at this point in the history
(workflow): instead build beta and stable docs on any trigger
  • Loading branch information
benjaminbollen authored Nov 18, 2024
2 parents cdcbd64 + e4ae1f0 commit 375db2c
Showing 1 changed file with 13 additions and 32 deletions.
45 changes: 13 additions & 32 deletions .github/workflows/deploy-mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@ jobs:
cd docs/
conda install -c conda-forge --file requirements.txt
- name: Build site
shell: bash -l {0}
- name: Build Beta Docs
run: |
git checkout beta
cd docs/
mkdocs build
mkdir -p ../gh-pages/beta
cp -R site/* ../gh-pages/beta
- name: Build Stable Docs
run: |
git checkout candidate/stable
cd docs/
mkdocs build
mkdir -p ../gh-pages/stable
cp -R site/* ../gh-pages/stable
- name: Create Redirect Index
run: |
Expand All @@ -45,36 +55,7 @@ jobs:
<body>
<p>Redirecting to the latest beta documentation...</p>
</body>
</html>' > ./docs/site/index.html
- name: Determine Deployment Directory
id: branch
run: |
if [[ "${GITHUB_REF_NAME}" == "beta" ]]; then
echo "DEPLOY_DIR=beta" >> $GITHUB_ENV
elif [[ "${GITHUB_REF_NAME}" == "candidate/stable" ]]; then
echo "DEPLOY_DIR=candidate" >> $GITHUB_ENV
elif [[ "${GITHUB_REF_NAME}" == "testdocs" ]]; then
echo "DEPLOY_DIR=test" >> $GITHUB_ENV
else
echo "Unknown branch: ${GITHUB_REF_NAME}" && exit 1
fi
- name: Prepare Deployment Directory
run: |
mkdir -p ./gh-pages/${{ env.DEPLOY_DIR }}
cp -R ./docs/site/* ./gh-pages/${{ env.DEPLOY_DIR }}
if [[ "${GITHUB_REF_NAME}" == "beta" ]]; then
echo '<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=beta/" />
</head>
<body>
<p>Redirecting to the latest beta documentation...</p>
</body>
</html>' > ./gh-pages/index.html
fi
</html>' > ./gh-pages/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down

0 comments on commit 375db2c

Please sign in to comment.