Skip to content

Commit

Permalink
Merge pull request #122 from ks6088ts/feature/issue-121_gh-pages
Browse files Browse the repository at this point in the history
support GitHub Pages
  • Loading branch information
ks6088ts authored Dec 6, 2024
2 parents 7de67a1 + 2737ef1 commit 26cd4a8
Show file tree
Hide file tree
Showing 8 changed files with 758 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: github-pages
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@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
shell: bash
run: |
make ci-test
make ci-test-docs
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,18 @@ docker-scan: ## scan Docker image

.PHONY: ci-test-docker
ci-test-docker: docker-lint docker-build docker-scan docker-run ## run CI test for Docker

# ---
# Docs
# ---

.PHONY: docs
docs: ## build documentation
poetry run mkdocs build

.PHONY: docs-serve
docs-serve: ## serve documentation
poetry run mkdocs serve

.PHONY: ci-test-docs
ci-test-docs: docs ## run CI test for documentation
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![docker](https://github.com/ks6088ts/template-python/actions/workflows/docker.yaml/badge.svg?branch=main)](https://github.com/ks6088ts/template-python/actions/workflows/docker.yaml?query=branch%3Amain)
[![docker-release](https://github.com/ks6088ts/template-python/actions/workflows/docker-release.yaml/badge.svg)](https://github.com/ks6088ts/template-python/actions/workflows/docker-release.yaml)
[![ghcr-release](https://github.com/ks6088ts/template-python/actions/workflows/ghcr-release.yaml/badge.svg)](https://github.com/ks6088ts/template-python/actions/workflows/ghcr-release.yaml)
[![docs](https://github.com/ks6088ts/template-python/actions/workflows/github-pages.yaml/badge.svg)](https://github.com/ks6088ts/template-python/actions/workflows/github-pages.yaml)

# template-python

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# template-python
44 changes: 44 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
site_name: template-python
site_url: ""
repo_url: https://github.com/ks6088ts/template-python
repo_name: ks6088ts/template-python
nav:
- Home: index.md
theme:
name: material
# https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference
icon:
repo: fontawesome/brands/github
language: en
extra:
social:
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/ks6088ts/
- icon: fontawesome/brands/github
link: https://github.com/ks6088ts
- icon: fontawesome/brands/x-twitter
link: https://x.com/ks6088ts
analytics:
provider: google
property: G-0ZTKFXVQ5K
665 changes: 664 additions & 1 deletion poetry.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pytest = "^8.3.4"
coverage = "^7.6.8"
pytest-cov = "^5.0.0"


[tool.poetry.group.docs.dependencies]
mkdocs-material = "^9.5.47"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Expand Down

0 comments on commit 26cd4a8

Please sign in to comment.