Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pkucmus committed Nov 21, 2023
1 parent caa03a7 commit da841e5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: docs

on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install hatch
- run: hatch docs:deploy
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: release

on:
release:
types:
- published

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ python = ["3.10", "3.11", "3.12"]

[tool.hatch.envs.docs]
dependencies = [
"mkdocs-material~=8.0",
"mkdocs-material~=9.0",
"mdx-include~=1.4.2",
"pygments-graphql~=1.0.0",
"mkdocs-awesome-pages-plugin~=2.8.0",
]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean --strict"
serve = "mkdocs serve --dev-addr localhost:8000"
deploy = "mkdocs gh-deploy --force"

[tool.hatch.envs.lint]
dependencies = [
Expand Down

0 comments on commit da841e5

Please sign in to comment.