diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0fa8b36..74d03fe 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -36,11 +36,21 @@ jobs: exit 0 fi + # For push events, check if this is the first push + if [ -z "${{ github.event.before }}" ]; then + echo "should_deploy=true" >> $GITHUB_OUTPUT + exit 0 + fi + # Check for changes in relevant files git diff --name-only ${{ github.event.before }} ${{ github.event.after }} > changed_files.txt + # Debug output + echo "Changed files:" + cat changed_files.txt + # Look for changes in docs, mkdocs.yml, or Python files - if grep -q -E '^docs/|^mkdocs.yml|\.py$' changed_files.txt; then + if grep -q -E '^docs/|^mkdocs\.yml|\.py$' changed_files.txt; then echo "should_deploy=true" >> $GITHUB_OUTPUT else echo "should_deploy=false" >> $GITHUB_OUTPUT