Merge pull request #36 from Elecrow-Download/patch-2 #896
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: Fetch Firmware | |
if: github.ref == 'refs/heads/0.6.2' | |
uses: robinraju/[email protected] | |
with: | |
repository: "HASwitchPlate/openHASP" | |
tag: "v0.6.2" | |
fileName: "*" | |
out-file-path: "docs/assets/firmware" | |
- name: Delete latest alias | |
if: github.ref == 'refs/heads/0.6.3' | |
run: | | |
mike delete --rebase -f "latest" | |
- name: Build docs from this branch | |
if: github.ref == 'refs/heads/0.6.3' | |
run: | | |
echo "Branchname: ${GITHUB_REF#refs/heads/}" | |
mike deploy --rebase --update-aliases --title="${GITHUB_REF#refs/heads/}" "${GITHUB_REF#refs/heads/}" | |
- name: Build docs from this branch | |
if: github.ref == 'refs/heads/0.7.0' | |
run: | | |
echo "Branchname: ${GITHUB_REF#refs/heads/}" | |
mike deploy --rebase --push --update-aliases --title="${GITHUB_REF#refs/heads/}" "${GITHUB_REF#refs/heads/}" "latest" | |
- name: Push docs from this branch | |
if: github.ref == 'refs/heads/0.7.0' | |
run: | | |
mike set-default --push latest | |
- 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 |