From 05204382bc6da40cefb0b60457c57deec528d2ac Mon Sep 17 00:00:00 2001 From: Stefan Charsley Date: Wed, 17 Jan 2024 19:20:51 +1300 Subject: [PATCH] feat: separate docs generation from builds (#1187) * Update builds.yml Signed-off-by: Stefan Charsley * Update builds.yml Signed-off-by: Stefan Charsley * Create docs.yaml Signed-off-by: Stefan Charsley * fix extension --------- Signed-off-by: Stefan Charsley --- .github/workflows/builds.yml | 38 ++++------------------------ .github/workflows/docs.yml | 49 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 461a8c92c9..a3090e8386 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -2,7 +2,11 @@ name: Builds on: push: + paths-ignore: + - 'Source/Docs/**' pull_request: + paths-ignore: + - 'Source/Docs/**' permissions: contents: write @@ -70,7 +74,7 @@ jobs: windows-build-packaging: name: Windows Build Packaging - needs: [windows-build, linux-build, macos-build, generate-docs, windows-unit-testing, linux-unit-testing, macos-unit-testing, windows-demo-testing, linux-demo-testing, macos-demo-testing] + needs: [windows-build, linux-build, macos-build, windows-unit-testing, linux-unit-testing, macos-unit-testing, windows-demo-testing, linux-demo-testing, macos-demo-testing] runs-on: windows-latest timeout-minutes: 15 if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master' @@ -165,38 +169,6 @@ jobs: name: macos-build-artifact path: bin - generate-docs: - name: Generate Documentation - runs-on: ubuntu-latest - timeout-minutes: 15 - if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master' - steps: - - name: Set python3.11 - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Update package repository - run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update - - name: Install Graphviz - run: sudo apt-get install -y graphviz - - name: Install Sphinx dependencies - run: pip3 install sphinx sphinxcontrib.httpdomain sphinx-prompt sphinx_rtd_theme sphinx-tabs - - name: Generate HTML website - run: sphinx-build -b html Source/Docs sphinx-docs - - name: Copy CNAME file - run: cp Source/Docs/CNAME sphinx-docs/ - - name: Copy .nojekyll file - run: cp Source/Docs/.nojekyll sphinx-docs/ - - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: sphinx-docs - branch: docs - windows-unit-testing: strategy: matrix: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..8000ecc436 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,49 @@ +name: Docs + +on: + push: + paths: + - 'Source/Docs/**' + pull_request: + paths: + - 'Source/Docs/**' + +permissions: + contents: write + +env: + BUILD_VERSION: 2.5.1.${{ github.run_number }} + +jobs: + + generate-docs: + name: Generate Documentation + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Set python3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Update package repository + run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update + - name: Install Graphviz + run: sudo apt-get install -y graphviz + - name: Install Sphinx dependencies + run: pip3 install sphinx sphinxcontrib.httpdomain sphinx-prompt sphinx_rtd_theme sphinx-tabs + - name: Generate HTML website + run: sphinx-build -b html Source/Docs sphinx-docs + - name: Copy CNAME file + run: cp Source/Docs/CNAME sphinx-docs/ + - name: Copy .nojekyll file + run: cp Source/Docs/.nojekyll sphinx-docs/ + - name: Deploy to GitHub Pages + if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master' + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: sphinx-docs + branch: docs