From 621d4bc2110f76cd8f9a63126c4ed84f3218921a Mon Sep 17 00:00:00 2001 From: Heba Elayoty Date: Tue, 13 Aug 2024 16:54:00 -0700 Subject: [PATCH] Add the missing checkout action and pass the release version Signed-off-by: Heba Elayoty --- .github/workflows/create-release.yml | 1 + .github/workflows/publish-image.yml | 9 ++++++++- .github/workflows/publish-init-container-image.yml | 9 +++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 984288dc..3c693d0c 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -114,4 +114,5 @@ jobs: uses: ./.github/workflows/publish-init-container-image.yml with: registry: ${{ needs.export-registry.outputs.registry }} + release_version: ${{ needs.check-tag.outputs.release-tag }} init_container_version: ${{ needs.check-tag.outputs.init-tag }} diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index ca11985f..8aeed725 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -25,6 +25,12 @@ jobs: publish-images: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + ref: {{ inputs.release_version }} + - name: Login to ${{ inputs.registry }} uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 with: @@ -36,11 +42,12 @@ jobs: run: | ver=${{ inputs.release_version }} echo "IMG_TAG=${ver#"v"}" >> $GITHUB_ENV + - name: Build and push image run: | OUTPUT_TYPE=type=registry make docker-build-image env: - VERSION: ${{ env.IMG_TAG }} + IMG_TAG: ${{ env.IMG_TAG }} REGISTRY: ${{ inputs.registry }} - name: Scan ${{ inputs.registry }}/${{ env.IMAGE_NAME }}:${{ env.IMG_TAG }} diff --git a/.github/workflows/publish-init-container-image.yml b/.github/workflows/publish-init-container-image.yml index e1403437..9fecb7f1 100644 --- a/.github/workflows/publish-init-container-image.yml +++ b/.github/workflows/publish-init-container-image.yml @@ -6,7 +6,11 @@ on: description: 'Which registry are we pushing the image to?' type: string required: true - init_container_version: + release_version: + description: 'Which version are we creating an image for?' + type: string + required: true + init_container_version: description: 'Which init container version are we creating an image for?' required: true type: string @@ -29,7 +33,7 @@ jobs: with: submodules: true fetch-depth: 0 - ref: ${{ steps.get-tag.outputs.tag }} + ref: { { inputs.release_version } } - name: Login to ${{ inputs.registry }} uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 @@ -42,6 +46,7 @@ jobs: run: | ver=${{ inputs.init_container_version }} echo "INIT_IMG_TAG=${ver#"v"}" >> $GITHUB_ENV + - name: Build and push image run: | OUTPUT_TYPE=type=registry make docker-build-init-image