Skip to content

Commit

Permalink
🧑‍💻 Deduplicate docs dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Apr 22, 2024
1 parent ef8ab09 commit 9957230
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches:
- master
- main
pull_request:
branches:
- master

permissions:
contents: read
Expand All @@ -17,15 +19,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
name: "📥 Checkout"

- uses: actions/setup-python@v5
name: "✨ Set up Python"
id: "setup-python"
with:
python-version: 3.x

- uses: actions/cache@v4
name: "🗃 Cache"
with:
Expand All @@ -35,12 +28,26 @@ jobs:
.cache
.venv
- name: "📥 Install Material for MkDocs"
- uses: actions/checkout@v4
name: "📥 Checkout"
with:
fetch-depth: 0

- name: "✨ Install Poetry"
run: |
python -m venv .venv
.venv/bin/pip install --upgrade 'mkdocs-material~=9.0' 'mkdocs-autorefs~=0.4' 'mkdocstrings[python]~=0.20' 'mkdocs-git-revision-date-localized-plugin~=1.1' pillow cairosvg
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: poetry

- name: "📥 Install dependencies"
run: poetry install --no-root --with=dev

- run: ".venv/bin/mkdocs build --site-dir _site"
- run: "make docs"
name: "📦 Build"

- name: "📤 Upload"
Expand All @@ -50,6 +57,7 @@ jobs:
name: "Deploy"
runs-on: ubuntu-latest
needs: "build"
if: github.event_name == 'push'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.benchmarks
.cache
_site

# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,python,windows,sublimetext,intellij+all,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,python,windows,sublimetext,intellij+all,visualstudiocode
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BIN := venv/bin

.PHONY: all
all: install lint test build
all: install lint test build docs

.PHONY: clean
clean:
Expand Down Expand Up @@ -45,3 +45,7 @@ benchmark:
.PHONY: build
build:
poetry build

.PHONY: docs
docs:
poetry run mkdocs build --site-dir _site
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ markdown_extensions:
- attr_list
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
Expand Down

0 comments on commit 9957230

Please sign in to comment.