Skip to content

Commit

Permalink
Fix docs deploy check for changes to docs (#139)
Browse files Browse the repository at this point in the history
* Try to fix check for changes in docs

* fix typo

* Remove tab

* Fix another typo

* Do not use deprecated set-output cmd

* Commmit empty file in docs

* Fix diff command to look for changes in docs

* Try again to fix diff command

* Try adding doc check into same deploy-docs doc

* Fix invalid workflow

* Try fixing diff command again

* Revert "Commmit empty file in docs"

This reverts commit acaefbd.

* Add console logs for debugging

* Fix bash conditional

* Add test file to trigger docs deploy

* Fix conditional again

* Fix git diff expression

* Try again to fix git diff expression

* Try to fix diff by checking out origin/master

* Try again to fix conditional

* Add back origin/master reference in diff

* REmove test file

* Fix indentation
  • Loading branch information
ezmiller authored Mar 22, 2024
1 parent 2865d59 commit c106eda
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c106eda

Please sign in to comment.