mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: Deploy MkDocs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Calculate requirements hash
|
|
id: req-hash
|
|
run: echo "hash=$(sha256sum requirements-doc.txt | awk '{print $1}')" >> $GITHUB_ENV
|
|
|
|
- name: Setup cache for pip
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cache/pip
|
|
.cache
|
|
key: ${{ runner.os }}-pip-${{ env.hash }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install Requirements
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
sudo apt-get update &&
|
|
sudo apt-get install pngquant &&
|
|
pip install -r requirements-doc.txt
|
|
|
|
- name: Fetch documentation branch
|
|
run: git fetch origin gh-pages --depth=1
|
|
|
|
- name: Build and deploy MkDocs
|
|
run: mkdocs gh-deploy --force
|