Skip to content

Merge pull request #70 from oshoval/fixut #68

Merge pull request #70 from oshoval/fixut

Merge pull request #70 from oshoval/fixut #68

Workflow file for this run

name: Push container image
on:
push:
branches:
- main
tags: [ 'v*.*.*' ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: kubevirt/ipam-controller
PASST_BINDING_CNI_IMAGE_NAME: kubevirt/passt-binding-cni
jobs:
push-amd64:
name: Image push/amd64
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
attestations: write
id-token: write
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Version Check
run: |
echo "git_commit_hash=$(git describe --no-match --always --abbrev=8 --dirty)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Login to Container Registry
if: github.repository_owner == 'kubevirt'
uses: docker/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch KubeVirt Release
run: |
KUBEVIRT_VERSION=$(curl -sSL https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)
echo "KUBEVIRT_VERSION=${KUBEVIRT_VERSION}" >> $GITHUB_ENV
- name: Push latest container image
if: github.repository_owner == 'kubevirt'
uses: docker/build-push-action@v5.3.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
file: Dockerfile
- name: Push latest passt binding cni container image
if: github.repository_owner == 'kubevirt'
uses: docker/build-push-action@v5.3.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.PASST_BINDING_CNI_IMAGE_NAME }}:latest
file: passt/Dockerfile
build-args: |
KUBEVIRT_VERSION=${{ env.KUBEVIRT_VERSION }}
- name: Push stable container image
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5.3.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
file: Dockerfile
- name: Push stable passt binding cni container image
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5.3.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.PASST_BINDING_CNI_IMAGE_NAME }}:${{ github.ref_name }}
file: passt/Dockerfile
build-args: |
KUBEVIRT_VERSION=${{ env.KUBEVIRT_VERSION }}
- name: Template release manifests
if: startsWith(github.ref, 'refs/tags/')
run: IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} make build-installer
- name: Release the kraken
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: |
dist/install.yaml