fix: Only run docker build on default branch or when Dockerfile changes
This commit is contained in:
parent
0181464b1b
commit
0bef114208
1 changed files with 5 additions and 2 deletions
|
@ -42,9 +42,12 @@ build_image_for_commit:
|
||||||
stage: test
|
stage: test
|
||||||
image: "docker:20.10"
|
image: "docker:20.10"
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
||||||
- changes:
|
when: on_success
|
||||||
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||||
|
changes:
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
|
when: on_success
|
||||||
services:
|
services:
|
||||||
- name: docker:20.10-dind
|
- name: docker:20.10-dind
|
||||||
before_script:
|
before_script:
|
||||||
|
|
Loading…
Reference in a new issue