From 6dea358828d4942308003f30a7babfb031f64dc6 Mon Sep 17 00:00:00 2001 From: Junfeng Qiao Date: Fri, 16 Feb 2024 19:09:39 +0100 Subject: [PATCH] Fix mkdocs deploy --- .github/workflows/{docs_ci.yml => docs.yml} | 14 ++++++++++--- .github/workflows/docs_deploy.yml | 22 --------------------- 2 files changed, 11 insertions(+), 25 deletions(-) rename .github/workflows/{docs_ci.yml => docs.yml} (70%) delete mode 100644 .github/workflows/docs_deploy.yml diff --git a/.github/workflows/docs_ci.yml b/.github/workflows/docs.yml similarity index 70% rename from .github/workflows/docs_ci.yml rename to .github/workflows/docs.yml index 45c4be09..9ae2103d 100644 --- a/.github/workflows/docs_ci.yml +++ b/.github/workflows/docs.yml @@ -1,8 +1,9 @@ -name: CI test docs +name: Build docs on: pull_request: - paths: - - docs/** + push: + branches: + - develop jobs: docs: @@ -26,3 +27,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ENABLE_MKDOCS_GIT_COMMITTERS: False + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/develop' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/site diff --git a/.github/workflows/docs_deploy.yml b/.github/workflows/docs_deploy.yml deleted file mode 100644 index 686afd28..00000000 --- a/.github/workflows/docs_deploy.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish docs via GitHub Pages -on: - push: - branches: - - master - - develop - -jobs: - build: - name: Deploy docs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@1.26 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ENABLE_MKDOCS_GIT_COMMITTERS: True - CONFIG_FILE: docs/mkdocs.yml - REQUIREMENTS: docs/requirements.txt