Skip to content

Commit

Permalink
Merge pull request #104 from aboutcircles/20241118-docs-update-beta
Browse files Browse the repository at this point in the history
(workflow): update docs for beta & stable
  • Loading branch information
benjaminbollen authored Nov 18, 2024
2 parents 653f1ed + 5fb3ce4 commit 5ef6598
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions .github/workflows/deploy-mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Deploy MkDocs to GitHub Pages
on:
push:
branches:
- v0.3.6-docs
- beta
- candidate/stable
- testdocs

jobs:
deploy:
Expand Down Expand Up @@ -33,8 +35,49 @@ jobs:
cd docs/
mkdocs build
- name: Create Redirect Index
run: |
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>' > ./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}" == "testdoc" ]]; 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
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/site
publish_dir: ./gh-pages

0 comments on commit 5ef6598

Please sign in to comment.