Add mkdocs folder for clarity #108
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy docs | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install -r .github/mkdocs/requirements.txt | |
- name: Copy all to docs folder | |
run: | | |
mkdir -p docs | |
shopt -s extglob | |
mv !(docs) docs/ | |
- name: Deploy documentation | |
run: | | |
if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
TAG=${{ github.ref_name }} | |
VERSION=$(echo ${TAG} | awk -F'.' '{print $1"."$2}') | |
fi | |
export BASE_URL=${BASE_URL}/${TAG:-main} | |
git fetch origin ${DOCS_BRANCH} --depth=1 | |
mike deploy -F ${DOCS_CONFIG} \ | |
--push --branch ${DOCS_BRANCH} \ | |
--update-aliases ${VERSION:-main} ${VERSION:+latest} | |
mike set-default -F ${DOCS_CONFIG} \ | |
--push --branch ${DOCS_BRANCH} latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_COMMITTER_NAME: ci-bot | |
GIT_COMMITTER_EMAIL: [email protected] | |
BASE_URL: https://github.com/SciCatProject/scicatlive/blob | |
DOCS_BRANCH: gh-pages | |
DOCS_CONFIG: .github/mkdocs/mkdocs.yaml |