-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If Docker CI Changes, then Run the CI for Docker in PR
- Loading branch information
Showing
1 changed file
with
5 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,16 @@ on: | |
branches: | ||
- main | ||
paths: | ||
- "./Dockerfile" | ||
- "./.github/workflows/docker_build.yml" | ||
- "Dockerfile" | ||
- ".github/workflows/docker_build.yml" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "./Dockerfile" | ||
- "./.github/workflows/docker_build.yml" | ||
- "Dockerfile" | ||
- ".github/workflows/docker_build.yml" | ||
types: [opened, synchronize, reopened, ready_for_review, review_requested] | ||
|
||
workflow_dispatch: # Add this line to enable manual trigger | ||
|
||
jobs: | ||
build: | ||
|
@@ -25,11 +25,7 @@ jobs: | |
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: false | ||
# all of these default to true, but feel free to set to | ||
# "false" if necessary for your workflow | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
|
@@ -39,17 +35,14 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# Conditional step for building image without pushing, for PRs | ||
- name: Build Docker Image (No Push) | ||
# if condition is pull request or push then it will build the image | ||
if: github.event_name == 'pull_request' || github.event_name == 'push' | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: false | ||
|
||
# Conditional steps for building and pushing, for pushes to main | ||
- name: Login to Docker Hub | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: docker/[email protected] | ||
|