Skip to content

Commit

Permalink
remove unwanted code from workflow (OT-CONTAINER-KIT#634)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <[email protected]>
Signed-off-by: Matt Robinson <[email protected]>
  • Loading branch information
shubham-cmyk authored and mattrobinsonsre committed Jul 11, 2024
1 parent 8abdf21 commit 76d72f3
Showing 1 changed file with 4 additions and 79 deletions.
83 changes: 4 additions & 79 deletions .github/workflows/release-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
ApplicationName: redis-operator
QuayImageName: quay.io/opstree/redis-operator
AppVersion: "v0.15.0"
AppVersion: "v0.15.1"
DOCKERFILE_PATH: '**/Dockerfile'

jobs:
Expand All @@ -30,104 +30,29 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.ACCESS_TOKEN }}

build_arm64:
needs: setup
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check existing AppVersion
id: check_version_arm64
run: |
EXISTS=$(curl -s https://quay.io/api/v1/repository/${{ env.QuayImageName }}/tag/?specificTag=${{ env.AppVersion }}-arm64 | jq '.tags | length')
echo "::set-output name=exists::$EXISTS"
- name: Build and push arm64 image
if: steps.check_version_arm64.outputs.exists == '0'
uses: docker/build-push-action@v2
with:
context: .
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/arm64
push: true
tags: ${{ env.QuayImageName }}:${{ env.AppVersion }}-arm64

build_amd64:
needs: setup
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check existing AppVersion
id: check_version_amd64
run: |
EXISTS=$(curl -s https://quay.io/api/v1/repository/${{ env.QuayImageName }}/tag/?specificTag=${{ env.AppVersion }}-amd64 | jq '.tags | length')
echo "::set-output name=exists::$EXISTS"
- name: Build and push amd64 image
if: steps.check_version_amd64.outputs.exists == '0'
uses: docker/build-push-action@v2
with:
context: .
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64
push: true
tags: ${{ env.QuayImageName }}:${{ env.AppVersion }}-amd64

build_multi_arch:
needs: setup
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check existing AppVersion
id: check_version_multi_arch
run: |
EXISTS=$(curl -s https://quay.io/api/v1/repository/${{ env.QuayImageName }}/tag/?specificTag=${{ env.AppVersion }} | jq '.tags | length')
echo "::set-output name=exists::$EXISTS"
- name: Build and push multi-arch image
if: steps.check_version_multi_arch.outputs.exists == '0'
uses: docker/build-push-action@v2
with:
context: .
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.QuayImageName }}:${{ env.AppVersion }}

- name: Build and push multi-arch latest image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.QuayImageName }}:latest
tags: ${{ env.QuayImageName }}:{{ env.AppVersion }}, ${{ env.QuayImageName }}:latest

trivy_scan:
needs: [build_arm64, build_amd64, build_multi_arch]
needs: [build_multi_arch]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Trivy vulnerability scanner for arm64 image
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.QuayImageName }}:${{ env.AppVersion }}-arm64
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-arm64.sarif'
exit-code: '1'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'
- name: Run Trivy vulnerability scanner for amd64 image
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.QuayImageName }}:${{ env.AppVersion }}-amd64
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-amd64.sarif'
exit-code: '1'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'

- name: Run Trivy vulnerability scanner for multi-arch image
uses: aquasecurity/trivy-action@master
with:
Expand Down

0 comments on commit 76d72f3

Please sign in to comment.