Merge pull request #164 from realratchet/master #89
Workflow file for this run
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: Generate Mkdocs and publish them to Pages | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- master | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: https://root-11.github.io/tablite/ | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.10' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Init Cache Var by Week Number (%V) | |
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- name: Use Cache | |
uses: actions/cache@v3 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
cache: pip | |
cache-dependency-path: | | |
requirements.txt | |
requirements_mkdocs.txt | |
- name: Install PIPs | |
run: | | |
python -m pip install -r requirements.txt | |
python -m pip install -r requirements_mkdocs.txt | |
- name: Show Python version and PIPs | |
run: | | |
python --version | |
python -m pip list | |
- name: Set Env for tablite Import | |
uses: allenevans/[email protected] | |
with: | |
PYTHONPATH: '.:tablite' | |
- uses: ./.github/actions/buildnim | |
- name: Configure Git user | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Get tag or branch name | |
id: get_tag_or_branch | |
run: | | |
echo "tag_or_branch=$(echo ${GITHUB_REF#refs/*/})" >> $GITHUB_OUTPUT | |
- name: Replace H1 to H2, H2 to H3, ... in all Juptyer Notebooks | |
run: | | |
find . -name "*.ipynb" -type f -exec sed -i 's/"#/"##/' {} \; | |
- name: Deploy with Mike | |
run: | | |
mike deploy --push --update-aliases ${{ steps.get_tag_or_branch.outputs.tag_or_branch }} latest | |
mike set-default --push latest | |
mike list |