Skip to content

Commit

Permalink
Conditional workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepanshuRohilla15 committed Sep 2, 2024
1 parent 3c6ab68 commit 640cf66
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ on:
push:
branches:
- main # Trigger the workflow on push to the main branch
# Only run when the commit message contains `BUILD_CONTAINER_IMAGE`
# This condition is defined in the job level
pull_request:
types:
- closed
branches:
- main # Trigger the workflow when a PR is merged into the main branch

jobs:
build:
if: |
github.event_name == 'pull_request' && github.event.pull_request.merged == true ||
(github.event_name == 'push' && contains(github.event.head_commit.message, 'BUILD_CONTAINER_IMAGE'))
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit 640cf66

Please sign in to comment.