Skip to content

Commit

Permalink
Accept k8s version to build node images
Browse files Browse the repository at this point in the history
  • Loading branch information
kishen-v committed Jul 15, 2024
1 parent c9bc674 commit e67f88e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ name: Docker

on:
workflow_dispatch:
schedule:
# Build the job every day for the master branch
- cron: '0 0 * * *'
inputs:
k8s-version:
description: 'The kubernetes version to be used for building node image.'
default: 'master'
required: false
type: string
push:
branches: [ "main", 'v*.*.*' ]
tags: [ 'v*.*.*' ]
branches: [ "main" ]
pull_request:
branches: [ "main", 'v*.*.*' ]
branches: [ "main" ]

jobs:
build:
Expand All @@ -23,13 +25,11 @@ jobs:
packages: write
strategy:
fail-fast: false
matrix:
version: ["master"]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: quay.io
# github.repository as <account>/<repo>
IMAGE_NAME: powercloud/kind-node
IMAGE_NAME: kviswana/kind-node


steps:
Expand Down Expand Up @@ -69,13 +69,13 @@ jobs:
make -C kind install
- name: Build kind-node image - ${{ matrix.version }}
- name: Build kind-node image - ${{ inputs.k8s-version }}
run: |
mkdir -p tmp/kubernetes
git clone --single-branch --filter=tree:0 --branch ${{ matrix.version }} https://github.com/kubernetes/kubernetes tmp/kubernetes
kind build node-image $PWD/tmp/kubernetes --arch ppc64le --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }} --base-image ${{ env.BASE_IMAGE }}
git clone --single-branch --filter=tree:0 --branch ${{ inputs.k8s-version }} https://github.com/kubernetes/kubernetes tmp/kubernetes
kind build node-image $PWD/tmp/kubernetes --arch ppc64le --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.k8s-version }} --base-image ${{ env.BASE_IMAGE }}
- name: Publish node image
if: github.event_name != 'pull_request'
run: |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.k8s-version }}

0 comments on commit e67f88e

Please sign in to comment.