ci: update github pages deployment #5
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: publish-docs | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# check-out repo and set-up python | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- name: Set custom domain | |
run: | | |
git fetch origin gh-pages | |
git checkout gh-pages | |
echo 'ecologits.ai' > CNAME | |
git add CNAME | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
# install & configure poetry | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
# install dependencies if cache does not exist | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --only docs | |
# deploy github pages | |
- name: Deploy GitHub Pages | |
run: poetry run mkdocs gh-deploy --force |