From 39597126bb621333b93f2f5060ca08b844ac81e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Rodri=CC=81guez?= Date: Tue, 10 Oct 2023 13:01:30 +0200 Subject: [PATCH] Build docs on PRs * Build the docs in PRs that modify /docs/manuals folder contents. * Only deploy the built docs if not building a PR. --- .github/workflows/docs.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b1d97b747e..c9bc76806f3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,11 +5,16 @@ on: branches: - 4.2.x paths: - - "docs/manual/**" + - "docs/manual/**" + pull_request: + branches: + - 4.2.x + paths: + - "docs/manual/**" workflow_dispatch: jobs: - deploy: + deploy-docs: runs-on: ubuntu-latest steps: - name: Checkout GeoNetwork @@ -24,7 +29,13 @@ jobs: run: pip install --upgrade pip && pip install -r docs/manual/requirements.txt - name: git configuration run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: deploy latest docs to gh-pages branch + - name: build docs without publishing them + if: ${{ github.event_name == 'pull_request' }} + working-directory: docs/manual + run: | + mike deploy --title "4.2 Stable" --no-redirect --update-aliases 4.2 stable + - name: deploy 4.2 docs to gh-pages branch + if: ${{ github.event_name != 'pull_request' }} working-directory: docs/manual run: | mike deploy --push --title "4.2 Stable" --no-redirect --update-aliases 4.2 stable