Skip to content

fixed docsite rm exclude regex #15

fixed docsite rm exclude regex

fixed docsite rm exclude regex #15

Workflow file for this run

name: Deploy Doc Site
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- 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 "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
save-always: true
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r src/requirements.txt -r doc/requirements.txt -r tests/requirements.txt
- name: Build site
run: nbsite build
- name: Move site root ➜
run: mv doc/site_root/* builtdocs/
- name: Push to docsite
run: |
git config --global user.name '${{ github.repository_owner }}'
git config --global user.email '${{ vars.OWNER_EMAIL }}'
git_hash=$(git rev-parse --short "$GITHUB_SHA")
git_branch=${GITHUB_REF#refs/heads/}
git fetch
git switch docsite
find . -mindepth 1 ! -regex '(^\.\/builtdocs\/.*)|(^\.\/\.git\/.*)' -delete
mv -vf builtdocs/{.[!.],}* ./
rmdir builtdocs
git add .
git commit -am "Deploying site from ${git_branch}@${git_hash}"
git push