Merge pull request #78 from jschintag/cross-build-podman #68
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push container image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
env: | |
image-push-owner: 'kubevirt' | |
jobs: | |
push: | |
name: Image push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Container Registry | |
if: github.repository_owner == 'kubevirt' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Version metadata | |
run: | | |
echo "git_commit_hash=$(git describe --no-match --always --abbrev=40 --dirty)" >> $GITHUB_ENV | |
- name: Set lower case repository name | |
run: | | |
echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITHUB_ENV} | |
env: | |
REPOSITORY: '${{ github.repository }}' | |
- name: Push latest container image | |
if: github.repository_owner == 'kubevirt' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/s390x,linux/arm64 | |
push: true | |
tags: ghcr.io/${{ env.REPOSITORY_LC }}:latest | |
file: Dockerfile | |
build-args: | | |
git_sha=${{ env.git_commit_hash }} | |
- name: Push tagged container image | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/s390x,linux/arm64 | |
push: true | |
tags: ghcr.io/${{ env.REPOSITORY_LC }}:${{ github.ref_name }} | |
file: Dockerfile | |
build-args: | | |
git_sha=${{ env.git_commit_hash }} | |
- name: Update release manifests | |
if: startsWith(github.ref, 'refs/tags/') | |
run: IMAGE=ghcr.io/${{ env.REPOSITORY_LC }}:${{ github.ref_name }} hack/update-manifest.sh | |
- name: Release the kraken | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
generate_release_notes: true | |
files: | | |
manifests/secondarydns.yaml |