diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 124d0a4..4676007 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -15,15 +15,24 @@ jobs: deploy-docs: runs-on: ubuntu-latest - # Only run this job if there were changes in the docs folder - paths: - - ./docs/* - steps: - name: Checkout uses: actions/checkout@v4 + - name: Check for changes in docs folder + id: docs_check + run: | + git fetch origin master + if [[ $(git diff --name-only origin/${{ github.event.repository.default_branch }} -- './docs') ]]; then + echo "There have been changes to the docs." + echo "docs_changed=true" >> $GITHUB_OUTPUT + else + echo "No changes to the docs." + echo "docs_changed=false" >> $GITHUB_OUTPUT + fi + - name: Deploy documentation + if: ${{ steps.docs_check.outputs.docs_changed == 'true' }} uses: JamesIves/github-pages-deploy-action@v4 with: folder: docs