-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable mkdocs and deploy to gh-pages
- Loading branch information
Showing
7 changed files
with
1,694 additions
and
1,648 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "ci | Publish docs via GitHub Pages" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- devel | ||
|
||
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 | ||
pip install mkdocs-git-authors-plugin | ||
- run: mkdocs gh-deploy --force | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - master | ||
|
||
# jobs: | ||
# build: | ||
# name: Deploy docs | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout main | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Deploy docs | ||
# uses: mhausenblas/mkdocs-deploy-gh-pages@master | ||
# # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme | ||
# # See: https://github.com/marketplace/actions/deploy-mkdocs | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# CUSTOM_DOMAIN: hedzr.com | ||
# CONFIG_FILE: ./mkdocs.yml | ||
# EXTRA_PACKAGES: build-base | ||
# # GITHUB_DOMAIN: github.myenterprise.com | ||
# REQUIREMENTS: ./requirements.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
site/ | ||
.venv/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
SHELL := /bin/bash | ||
GH_PAGE := docs | ||
# hedzr.github.io | ||
|
||
.PHONY: deploy | ||
deploy: | ||
cd $(GH_PAGE) && mkdocs gh-deploy --config-file ../mkdocs.yml --remote-branch master | ||
|
||
# .PHONY: update-build-version | ||
# update-build-version: | ||
# git submodule update --remote --merge | ||
# git add $(GH_PAGE) | ||
# git commit -m "ci: update build version" | ||
|
||
# .PHONY: publish | ||
# publish: deploy update-build-version | ||
# git push --no-verify | ||
|
||
dev: preview | ||
preview: live-preview | ||
live-preview: | ||
mkdocs serve --dev-addr 0.0.0.0:7317 --open --dirty | ||
|
||
init-env: | ||
python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip | ||
pip install mkdocs |
Oops, something went wrong.