Skip to content

Commit 9d31b8b

Browse files
committed
fix: Add matrix condition to each step
1 parent 0aabb9d commit 9d31b8b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/build_and_push.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,36 @@ jobs:
3939
permissions:
4040
contents: read
4141
packages: write
42-
if: ${{ matrix.condition }}
4342

4443
steps:
4544
- name: Checkout repository
4645
uses: actions/checkout@v3
4746
with:
4847
ref: ${{ github.event.inputs.commit_sha }}
48+
if: ${{ matrix.condition }}
4949

5050
- name: Set up Go
5151
uses: actions/setup-go@v4
5252
with:
5353
go-version: '1.23'
54+
if: ${{ matrix.condition }}
5455

5556
- name: Set up Docker Buildx
5657
uses: docker/setup-buildx-action@v3
58+
if: ${{ matrix.condition }}
5759

5860
- name: Log in to the Container registry
5961
uses: docker/login-action@v3
6062
with:
6163
registry: ${{ env.REGISTRY }}
6264
username: ${{ github.actor }}
6365
password: ${{ secrets.GITHUB_TOKEN }}
66+
if: ${{ matrix.condition }}
6467

6568
- name: Set Tag Name
6669
id: set_tag
6770
run: echo "tag=${{ github.event.inputs.release_tag || github.event.inputs.commit_sha }}" >> $GITHUB_OUTPUT
71+
if: ${{ matrix.condition }}
6872

6973
- name: Build and push Docker image
7074
uses: docker/build-push-action@v6
@@ -75,3 +79,4 @@ jobs:
7579
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.service }}:${{ steps.set_tag.outputs.tag }}
7680
cache-from: type=gha,scope=${{ matrix.service }}
7781
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
82+
if: ${{ matrix.condition }}

0 commit comments

Comments
 (0)