update #874
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: MkDocs | |
on: push | |
jobs: | |
mkdocs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Python and dependencies | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- run: pip install --upgrade pip wheel | |
- run: pip install --upgrade setuptools==57.4.0 | |
- run: pip install -r requirements.txt | |
- name: Branch name | |
run: echo running on branch ${GITHUB_REF#refs/heads/} | |
- name: Set up git author | |
run: | | |
remote_repo="https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git remote rm origin | |
git remote add origin "${remote_repo}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Fetch github pages | |
run: | | |
git fetch origin gh-pages --verbose | |
- name: Release docs from this branch | |
run: | | |
echo "Branchname: ${GITHUB_REF#refs/heads/}" | |
mike deploy --push --rebase --update-aliases "${GITHUB_REF#refs/heads/}" --title "${GITHUB_REF#refs/heads/}" | |
- name: List | |
run: | | |
mike list | |
# env: | |
# CUSTOM_DOMAIN: docs.haswitchplate.com | |
# - name: Deploy docs (Self-hosted) | |
# if: startsWith(github.ref, 'refs/heads/release/v') | |
# run: | | |
# git fetch origin gh-pages --verbose | |
# mike deploy ${GITHUB_REF##*/release/} -t "Self-hosted ${GITHUB_REF##*/release/}" --config-file "${GITHUB_WORKSPACE}/mkdocs.yml" --push --rebase |