From c44a1221f1f63f17bc3ba486e6b36f9843ef1068 Mon Sep 17 00:00:00 2001 From: dixxond Date: Wed, 4 Dec 2024 11:52:21 +0100 Subject: [PATCH] features(documentation): deploy doc only if there is an update --- .github/workflows/buildGithubPage.yml | 59 +++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildGithubPage.yml b/.github/workflows/buildGithubPage.yml index ca2394d..d67d24a 100644 --- a/.github/workflows/buildGithubPage.yml +++ b/.github/workflows/buildGithubPage.yml @@ -5,13 +5,64 @@ on: - "features/dka/docs" jobs: - publish-documentation: + + check-changes-api-doc: + name: Check for changes in api documentation + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: dorny/paths-filter@v3 + id: api-doc-change + with: + filters: | + src: + - 'api/**' + + check-changes-client-doc: + name: Check for changes in client documentation + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: dorny/paths-filter@v3 + id: client-doc-change + with: + filters: | + src: + - 'client/**' + + publish-api-documentation: + name: Publish api documentation + if: steps.api-doc-change.outputs.src == 'true' permissions: id-token: "write" pages: "write" - + runs-on: "ubuntu-latest" - + + steps: + - id: "checkout" + name: "Check out Git repository" + uses: "actions/checkout@v3" + + - id: "upload-documentation" + name: "Upload Pages artifact" + uses: "actions/upload-pages-artifact@v2" + with: + path: "api/" + + - id: "deployment" + name: "Deploy documentation to GitHub Pages" + uses: "actions/deploy-pages@v2" + + publish-client-documentation: + name: Publish client documentation + if: steps.client-doc-change.outputs.src == 'true' + permissions: + id-token: "write" + pages: "write" + + runs-on: "ubuntu-latest" + steps: - id: "checkout" name: "Check out Git repository" @@ -21,7 +72,7 @@ jobs: name: "Upload Pages artifact" uses: "actions/upload-pages-artifact@v2" with: - path: "docs/" + path: "client/" - id: "deployment" name: "Deploy documentation to GitHub Pages"