Skip to content

Instantly share code, notes, and snippets.

@graste
Last active June 18, 2020 08:22
Show Gist options
  • Save graste/9b52369b586f71a4d612ef566ffef0bd to your computer and use it in GitHub Desktop.
Save graste/9b52369b586f71a4d612ef566ffef0bd to your computer and use it in GitHub Desktop.
run job only on certain branch when certain file has changed in gitlab ci with rules
rules:
- if: '$CI_COMMIT_BRANCH != "mybranch"'
when: never
- changes:
- ${DOCKERFILE}
when: always
rules:
- if: "$CI_COMMIT_BRANCH != 'mybranch'"
when: never
- changes:
- Dockerfile
when: always
- when: never
@graste
Copy link
Author

graste commented Jun 16, 2020

- when: on_success as last (default) rule to set job as succeeded if necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment