This commit is contained in:
Jason Liu
2023-11-06 22:39:56 -05:00
parent dcc2bb21de
commit 7bc2259b40
+16 -10
View File
@@ -25,29 +25,35 @@ jobs:
- name: Calculate requirements hash
id: req-hash
run: echo "::set-output name=hash::$(sha256sum requirements-doc.txt | awk '{print $1}')"
run: echo "hash=$(sha256sum requirements-doc.txt | awk '{print $1}')" >> $GITHUB_ENV
- name: Setup cache
- name: Setup cache for pip
uses: actions/cache@v3
with:
key: mkdocs-material-${{ steps.req-hash.outputs.hash }}
path: .cache
path: |
~/.cache/pip
.cache
key: ${{ runner.os }}-pip-${{ env.hash }}
restore-keys: |
mkdocs-material-
${{ 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
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Fetch documentation branch
run: git fetch origin gh-pages --depth=1
- name: Configure Git User
run: |
git config user.name "actions"
git config user.email "actions@github.com"
- name: Get current tag
id: get-tag
run: |
echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
run: echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Build and deploy with mike
run: mike deploy --update-aliases ${{ env.version }} latest --ignore-remote-status