Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add the missing checkout action and pass the release version #648

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
9 changes: 8 additions & 1 deletion .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/publish-init-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading