Skip to content

Commit

Permalink
build-images-ci: fix GH action
Browse files Browse the repository at this point in the history
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
  • Loading branch information
kkourt committed Oct 31, 2023
1 parent 4765b0a commit 0f64fb2
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/build-images-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ jobs:
else
echo "tag=${{ github.sha }}" >> $GITHUB_OUTPUT
fi
if [ ${{ github.event_name }} == "push" ]; then
if [ ${{ github.ref_name }} == "main" ]; then
echo "name=latest" | tee -a $GITHUB_OUTPUT
else
echo "name=${{ github.ref_name }}" | tee -a $GITHUB_OUTPUT
fi
fi
- name: Checkout master branch
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
Expand Down Expand Up @@ -98,24 +105,7 @@ jobs:
# main branch pushes
- name: CI Build (main)
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
id: docker_build_ci_main
with:
provenance: false
context: .
file: ${{ matrix.dockerfile }}
push: true
platforms: linux/amd64,linux/arm64
build-args: |
TETRAGON_VERSION=${{ env.TETRAGON_VERSION }}
tags: |
quay.io/${{ github.repository_owner }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}
quay.io/${{ github.repository_owner }}/${{ matrix.name }}-ci:latest
# non-main branch pushes
- name: CI Build (non-main)
if: ${{ github.event_name == 'push' && github.ref_name != 'main' }}
if: ${{ github.event_name == 'push' }}
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
id: docker_build_ci_main
with:
Expand All @@ -128,6 +118,7 @@ jobs:
TETRAGON_VERSION=${{ env.TETRAGON_VERSION }}
tags: |
quay.io/${{ github.repository_owner }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}
quay.io/${{ github.repository_owner }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.name }}
- name: Sign Container Image
if: github.event_name == 'push'
Expand Down

0 comments on commit 0f64fb2

Please sign in to comment.