Skip to content

Commit

Permalink
ci: updated ci with deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jankovicgd committed Nov 22, 2024
1 parent 3ec392e commit 8b5692e
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Deploy mkdocs to github pages

on:
push:
branches:
Expand All @@ -17,15 +19,17 @@ on:
types:
- released
jobs:
pages:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- 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
- uses: actions/setup-python@v5
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install poetry
Expand All @@ -34,17 +38,33 @@ jobs:
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
- name: Define a cache for the virtual environment based on the dependencies lock file
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
- name: Cache the virtual env
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: poetry install
- run: poetry run mkdocs gh-deploy --force
- name: Install project dependencies
run: poetry install
- name: Build the documentation
run: poetry run mkdocs build --strict --site-dir _site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 8b5692e

Please sign in to comment.