|
37 | 37 | runs-on: ubuntu-20.04 |
38 | 38 | outputs: |
39 | 39 | sha: ${{ steps.vars.outputs.sha }} |
40 | | - version: ${{ steps.vars.outputs.version }} |
41 | | - date: ${{ steps.vars.outputs.date }} |
42 | 40 | go_path: ${{ steps.vars.outputs.go_path }} |
43 | 41 | steps: |
44 | 42 | - name: Checkout Repository |
|
52 | 50 | id: vars |
53 | 51 | run: | |
54 | 52 | echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)" |
55 | | - echo "::set-output name=version::$(grep "VERSION = " Makefile | cut -d " " -f 3)" |
56 | | - echo "::set-output name=date::$(date -u +"%Y-%m-%dT%H:%M:%SZ")" |
57 | 53 | echo "::set-output name=go_path::$(go env GOPATH)" |
58 | 54 | - name: Check if go.mod and go.sum are up to date |
59 | 55 | run: | |
@@ -195,24 +191,23 @@ jobs: |
195 | 191 | type=edge |
196 | 192 | type=ref,event=pr |
197 | 193 | type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }} |
| 194 | +
|
198 | 195 | - name: Build Docker Image |
199 | 196 | uses: docker/build-push-action@v3 |
200 | 197 | with: |
201 | 198 | file: build/Dockerfile |
202 | 199 | context: '.' |
203 | 200 | target: goreleaser |
204 | 201 | tags: ${{ steps.meta.outputs.tags }} |
| 202 | + labels: ${{ steps.meta.outputs.labels }} |
205 | 203 | load: ${{ github.event_name == 'pull_request' }} |
206 | 204 | push: ${{ github.event_name != 'pull_request' }} |
207 | 205 | platforms: ${{ github.event_name != 'pull_request' && env.platforms || '' }} |
208 | 206 | cache-from: type=gha |
209 | 207 | cache-to: type=gha,mode=max |
210 | 208 | pull: true |
211 | 209 | no-cache: ${{ github.event_name != 'pull_request' }} |
212 | | - build-args: | |
213 | | - VERSION=${{ needs.vars.outputs.version }} |
214 | | - GIT_COMMIT=${{ needs.vars.outputs.sha }} |
215 | | - DATE=${{ needs.vars.outputs.date }} |
| 210 | + |
216 | 211 | - name: Run Trivy vulnerability scanner |
217 | 212 | uses: aquasecurity/[email protected] |
218 | 213 | continue-on-error: true |
|
0 commit comments