-
Notifications
You must be signed in to change notification settings - Fork 2
ci: skip docker-build on PRs that don't change Docker/deps #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,13 +57,33 @@ jobs: | |||||
| path: coverage.xml | ||||||
|
|
||||||
| # --------------------------------------------------------------- | ||||||
| # Job 2 — Build Docker images (only when Docker files change) | ||||||
| # Job 0 — Detect whether Docker-relevant files changed | ||||||
| # --------------------------------------------------------------- | ||||||
| changes: | ||||||
| runs-on: ubuntu-latest | ||||||
| outputs: | ||||||
| docker: ${{ steps.filter.outputs.docker }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: dorny/paths-filter@v3 | ||||||
| id: filter | ||||||
| with: | ||||||
| filters: | | ||||||
| docker: | ||||||
| - 'docker/**' | ||||||
| - 'pyproject.toml' | ||||||
| - 'uv.lock' | ||||||
| - 'requirements.txt' | ||||||
| - '.github/workflows/ci.yml' | ||||||
|
|
||||||
| # --------------------------------------------------------------- | ||||||
| # Job 2 — Build Docker images (only when Docker-relevant files change) | ||||||
| # --------------------------------------------------------------- | ||||||
| docker-build: | ||||||
| runs-on: ubuntu-latest | ||||||
| needs: lint-and-test | ||||||
| needs: [lint-and-test, changes] | ||||||
| if: > | ||||||
| github.event_name == 'pull_request' || | ||||||
| needs.changes.outputs.docker == 'true' || | ||||||
| contains(github.event.head_commit.message, '[docker]') | ||||||
|
||||||
| contains(github.event.head_commit.message, '[docker]') | |
| contains(github.event.head_commit.message || '', '[docker]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
ci.ymlis called fromdeploy.ymlviaworkflow_callon version tags, this newchanges/docker-buildgating will also be evaluated during CD. If Docker builds are meant to be PR-only (as the PR description suggests), consider guarding these jobs withif: github.event_name == 'pull_request'or adding a workflow input to disable docker builds for CD invocations.