Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 0f18205

Browse files
committed
👷 Merge docker build + push step
1 parent c11c47e commit 0f18205

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

.github/workflows/pull-request.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ jobs:
191191
with:
192192
ref: ${{ env.PULL_REQUEST_HEAD }}
193193

194+
- name: Log in to registry
195+
if: ${{ env.FORKED == 'false' }}
196+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ env.REGISTRY }} -u $ --password-stdin
197+
194198
- name: Build image
195199
id: docker-meta
196200
env:
@@ -200,16 +204,6 @@ jobs:
200204
TAG_SUFFIX=$(echo "-${{ matrix.name }}" | sed s/-ubuntu//)
201205
echo "image-id=$IMAGE_NAME" >> $GITHUB_OUTPUT
202206
echo "image-version=${VERSION}${TAG_SUFFIX}" >> $GITHUB_OUTPUT
203-
204-
- name: Log in to registry
205-
if: ${{ env.FORKED == 'false' }}
206-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ env.REGISTRY }} -u $ --password-stdin
207-
208-
- name: Push image
209-
if: ${{ env.FORKED == 'false' }}
210-
env:
211-
VERSION: "${{ needs.release.outputs.version }}"
212-
run: |
213207
make push-${{ matrix.name }}-image
214208
215209
- name: Format current time

.github/workflows/release.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
- name: Checkout
132132
uses: actions/checkout@v3
133133

134-
- name: Set releasw version
134+
- name: Set release version
135135
id: version
136136
run: echo "version=${{ needs.build.outputs.version }}" >> $GITHUB_OUTPUT
137137

@@ -173,6 +173,9 @@ jobs:
173173
- name: Checkout
174174
uses: actions/checkout@v3
175175

176+
- name: Log in to registry
177+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ env.REGISTRY }} -u $ --password-stdin
178+
176179
- name: Build image
177180
id: docker-meta
178181
env:
@@ -182,14 +185,6 @@ jobs:
182185
TAG_SUFFIX=$(echo "-${{ matrix.name }}" | sed s/-ubuntu//)
183186
echo "image-id=$IMAGE_NAME" >> $GITHUB_OUTPUT
184187
echo "image-version=${VERSION}${TAG_SUFFIX}" >> $GITHUB_OUTPUT
185-
186-
- name: Log in to registry
187-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ env.REGISTRY }} -u $ --password-stdin
188-
189-
- name: Push image
190-
env:
191-
VERSION: "${{ needs.release.outputs.version }}"
192-
run: |
193188
make push-${{ matrix.name }}-image
194189
195190
- name: Setup cosign
@@ -210,7 +205,7 @@ jobs:
210205
run: make sign-${{ matrix.name }}-image
211206

212207
- name: Container scan
213-
uses: aquasecurity/trivy-action@0.8.0
208+
uses: aquasecurity/trivy-action@0.14.0
214209
env:
215210
image-ref: "${{ steps.docker-meta.outputs.image-id }}:${{ steps.docker-meta.outputs.image-version }}"
216211
with:

0 commit comments

Comments
 (0)