Skip to content

Commit

Permalink
Add image build for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
DoPaNik committed Nov 11, 2023
1 parent b4bc6c1 commit f5e9ba6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/buildAndPushContainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v2
with:
context: ./supplychain/container/
Expand All @@ -44,12 +45,26 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build Docker image for pull request
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v2
with:
context: ./supplychain/container/
file: ./supplychain/container/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ntdominikpabst/it-tage-ffm-2023-devops:${{ github.sha }}_PR${{ github.event.number }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Docker Scout
id: docker-scout
if: ${{ github.event_name == 'pull_request' }}
uses: docker/scout-action@v1
with:
command: quickview,cves,recommendations,sbom
image: ntdominikpabst/it-tage-ffm-2023-devops:${{ github.sha }}_PR${{ github.event.number }}
to-latest: true
ignore-base: true
ignore-unchanged: true
Expand Down

0 comments on commit f5e9ba6

Please sign in to comment.