From 6e4bf27545733e467b3fb1bc4833a960790f5fc5 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Fri, 1 Dec 2023 16:58:37 +0800 Subject: [PATCH] ci: add mkdoc workflow Signed-off-by: Huaqi Fang <578567190@qq.com> --- .github/mkdoc.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/mkdoc.yml diff --git a/.github/mkdoc.yml b/.github/mkdoc.yml new file mode 100644 index 0000000..9d49cac --- /dev/null +++ b/.github/mkdoc.yml @@ -0,0 +1,47 @@ +name: Deploy MkDocs + +on: + push: + branches: + - main + pull_request: + branches: [ main ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip3 install mkdocs mkdocs-material + + - name: Prepare docs + run: | + python3 update.py + mkdir docs + cp *.md docs/ + cp -rf asserts/ docs/ + # update mkdocs.yml + python3 update.py + + - name: Build MkDocs + run: mkdocs build + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + if: ${{ github.ref == 'refs/heads/main' }} + with: + branch: gh-pages + folder: ./site + +