Skip to content

Commit

Permalink
ci: add bool.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Sep 30, 2023
1 parent 6eff73a commit 66fd3cb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and deploy book

on:
push:
branches:
- master
paths:
- "book/**.md"
- "book/mkdocs.yml"
workflow_dispatch:

jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: book/
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.BOOK_DEPLOY_KEY }}
- name: Set up Python Virtualenv
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: make init
- name: Deploy
run: |
git config user.name github-actions
git config user.email [email protected]
make deploy
6 changes: 5 additions & 1 deletion book/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ init:
poetry install

build:
poetry run mkdocs build --strict --clean --verbose
poetry run mkdocs build --strict --clean --verbose --site-dir public

deploy: build
git submodule update --init --force
cd public && git add . && git commit -m "Deploy book" && git push

serve:
mkdocs serve

0 comments on commit 66fd3cb

Please sign in to comment.