mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-30 04:30:44 -06:00
docs: use peaceiris action
This commit is contained in:
parent
b19ddbae68
commit
b855afa0bb
2 changed files with 44 additions and 9 deletions
51
.github/workflows/docs.yml
vendored
51
.github/workflows/docs.yml
vendored
|
@ -1,19 +1,52 @@
|
|||
name: docs
|
||||
name: GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
contents: write
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: pip install mkdocs-material \
|
||||
mkdocs-git-revision-date-localized-plugin
|
||||
- run: mkdocs gh-deploy --force
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Upgrade pip
|
||||
run: |
|
||||
# install pip=>20.1 to use "pip cache dir"
|
||||
python3 -m pip install --upgrade pip
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
run: python3 -m pip install -r ./requirements-docs.txt
|
||||
|
||||
- run: mkdocs build
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./site
|
||||
|
|
2
requirements-docs.txt
Normal file
2
requirements-docs.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
mkdocs-material
|
||||
mkdocs-git-revision-date-localized-plugin
|
Loading…
Reference in a new issue