updated NC versions, pinned checkout action to number. (#128) #136
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: Docs | |
on: | |
push: | |
branches: [ main ] | |
permissions: | |
contents: read | |
jobs: | |
build_push_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Docs dependencies | |
run: python3 -m pip install ".[docs]" | |
- name: Build and push Docs | |
run: | | |
export CHANGES_DATE=`date -d"@$(git log -1 --pretty=%ct)" --iso-8601=seconds` | |
make html | |
git config --global user.name bigcat88 | |
git config --global user.email "[email protected]" | |
docroot=`mktemp -d` | |
rsync -av "docs/_build/html/" "${docroot}/" | |
pushd "${docroot}" | |
git init | |
git remote add deploy "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git checkout -b gh-pages | |
touch .nojekyll | |
git add . | |
msg="Docs: commit ${GITHUB_SHA} made on ${CHANGES_DATE} from ${GITHUB_REF} by ${GITHUB_ACTOR}" | |
git commit -am "${msg}" | |
git push deploy gh-pages --force | |
popd | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_DOCS }} |