From 262b10a3efdac875c1ea105bd47d3cf99f54d5bd Mon Sep 17 00:00:00 2001 From: dannda Date: Tue, 7 Nov 2023 17:21:30 +0000 Subject: [PATCH] set build-docs action for pull requests as check and deploy-docs action for pushes to main --- .github/workflows/build-sphinx.yml | 30 +++++++++++++++++++ .../{sphinx-build.yml => deploy-sphinx.yml} | 9 ++---- 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build-sphinx.yml rename .github/workflows/{sphinx-build.yml => deploy-sphinx.yml} (89%) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml new file mode 100644 index 0000000..0554001 --- /dev/null +++ b/.github/workflows/build-sphinx.yml @@ -0,0 +1,30 @@ +name: build-docs + +on: + push: + branches: [dev] + + pull_request: + branches: [main, dev] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r ./envs/requirements.txt + pip install -r ./envs/dev/requirements.txt + pip install -r ./envs/build_config/requirements.txt + - name: Sphinx Build + working-directory: ./sphinx + run: | + make html + touch _build/html/.nojekyll diff --git a/.github/workflows/sphinx-build.yml b/.github/workflows/deploy-sphinx.yml similarity index 89% rename from .github/workflows/sphinx-build.yml rename to .github/workflows/deploy-sphinx.yml index d729751..25d5521 100644 --- a/.github/workflows/sphinx-build.yml +++ b/.github/workflows/deploy-sphinx.yml @@ -1,13 +1,10 @@ -name: docs +name: deploy-docs on: push: - branches: [main, dev] + branches: [main] tags: ["v*"] - pull_request: - branches: [main, dev] - jobs: run: runs-on: ubuntu-latest @@ -32,7 +29,7 @@ jobs: - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.4.1 with: - branch: dev + branch: gh-pages folder: sphinx/_build/html target-folder: docs clean: true