15c72452de
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.6 to 2.1.7. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2.1.6...v2.1.7) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
72 lines
2.4 KiB
YAML
72 lines
2.4 KiB
YAML
name: mkdocs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
mkdocs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
# git-revision-date-localized-plugin and mkdocs-rss-plugin need full git history depth
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2.3.0
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- uses: actions/cache@v2.1.7
|
|
id: cache
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
- name: Install dependencies
|
|
working-directory: ./mkdocs
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
python -m pip install -r requirements.txt
|
|
- name: Build docs
|
|
working-directory: ./mkdocs
|
|
run: |
|
|
mkdocs build
|
|
# - name: Validate generated HTML files
|
|
# working-directory: ./mkdocs
|
|
# run: |
|
|
# docker run -v $(pwd):/test --rm wjdp/htmltest --conf .htmltest.yml
|
|
# On push to master or release branch, deploy docs
|
|
- 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: Deploy docs (Master)
|
|
if: github.ref == 'refs/heads/master'
|
|
working-directory: ./mkdocs
|
|
run: |
|
|
echo "${CUSTOM_DOMAIN}" > "${GITHUB_WORKSPACE}/mkdocs/docs/CNAME"
|
|
echo -e "User-agent: *\nDisallow: /v*.*/\nSitemap: https://${CUSTOM_DOMAIN}/sitemap.xml" > "${GITHUB_WORKSPACE}/mkdocs/docs/robots.txt"
|
|
git fetch origin gh-pages --verbose
|
|
mike deploy master dev --config-file "${GITHUB_WORKSPACE}/mkdocs/mkdocs.yml" --push --rebase
|
|
env:
|
|
CUSTOM_DOMAIN: distribyted.com
|
|
|
|
- name: Deploy docs (Versions)
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
git fetch origin gh-pages --verbose
|
|
mike deploy ${GITHUB_REF##*/} latest --config-file "${GITHUB_WORKSPACE}/mkdocs/mkdocs.yml" --push --rebase --update-aliases
|
|
|