diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index 5275355f50..109c5c6699 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -3,26 +3,35 @@ name: docs on: pull_request: branches: [main] - paths: - - 'flaml/*' - - 'website/*' - - '.github/workflows/deploy-website.yml' push: branches: [main] - paths: - - 'flaml/*' - - 'website/*' - - '.github/workflows/deploy-website.yml' workflow_dispatch: merge_group: types: [checks_requested] permissions: contents: write + pull-requests: read jobs: + changes: + runs-on: ubuntu-latest + outputs: + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + docs: + - 'flaml/**' + - 'website/**' + - '.github/workflows/deploy-website.yml' + checks: - if: github.event_name != 'push' + needs: changes + if: github.event_name != 'push' && (needs.changes.outputs.docs == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group') runs-on: ubuntu-latest defaults: run: @@ -58,7 +67,8 @@ jobs: npm run build fi gh-release: - if: github.event_name != 'pull_request' + needs: changes + if: github.event_name != 'pull_request' && (needs.changes.outputs.docs == 'true' || github.event_name == 'workflow_dispatch') runs-on: ubuntu-latest defaults: run: