Skip to content

Commit c912b66

Browse files
committedJan 16, 2025
ci: Update GitHub Actions workflow to use github.event_name for build conditions
1 parent d62c43b commit c912b66

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎.github/workflows/docker-build-test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
uses: docker/setup-buildx-action@v3
3737

3838
- name: Login to DockerHub
39-
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
39+
if: ${{ github.event_name != 'pull_request' }}
4040
uses: docker/login-action@v3
4141
with:
4242
username: ${{ secrets.DOCKERHUB_USERNAME }}
4343
password: ${{ secrets.DOCKERHUB_PASSWORD }}
4444

4545
- name: Build Docker images (PR)
46-
if: ${{ secrets.DOCKERHUB_USERNAME == '' }}
46+
if: ${{ github.event_name == 'pull_request' }}
4747
uses: docker/build-push-action@v5
4848
with:
4949
context: .
@@ -53,7 +53,7 @@ jobs:
5353
target: aider
5454

5555
- name: Build Docker images (Push)
56-
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
56+
if: ${{ github.event_name != 'pull_request' }}
5757
uses: docker/build-push-action@v5
5858
with:
5959
context: .
@@ -64,7 +64,7 @@ jobs:
6464
target: aider
6565

6666
- name: Build Docker full image (PR)
67-
if: ${{ secrets.DOCKERHUB_USERNAME == '' }}
67+
if: ${{ github.event_name == 'pull_request' }}
6868
uses: docker/build-push-action@v5
6969
with:
7070
context: .
@@ -74,7 +74,7 @@ jobs:
7474
target: aider-full
7575

7676
- name: Build Docker full image (Push)
77-
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
77+
if: ${{ github.event_name != 'pull_request' }}
7878
uses: docker/build-push-action@v5
7979
with:
8080
context: .

0 commit comments

Comments
 (0)
Please sign in to comment.