Build kindest/node on branch #199
This file contains hidden or 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: Build kindest/node on branch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to checkout' | |
| required: true | |
| default: 'main' | |
| k8sversion: | |
| description: 'Kubernetes git version' | |
| required: true | |
| default: 'v1.34.0' | |
| version: | |
| description: 'Version to build' | |
| required: true | |
| default: 'latest' | |
| env: | |
| VERSION: ${{ github.event.inputs.version }} | |
| IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
| jobs: | |
| checkout-job: | |
| runs-on: ubuntu-latest | |
| env: | |
| IMAGE_NAME: kindest/node | |
| KUBE_GIT_VERSION: ${{ github.event.inputs.k8sversion }} | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.25.3 | |
| - name: Install Kind | |
| run: | | |
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-linux-amd64 | |
| chmod +x ./kind | |
| mv ./kind /usr/local/bin | |
| - name: Set up Docker | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to Docker | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ secrets.GH_USERNAME }} | |
| password: ${{ secrets.GH_TOKEN }} | |
| - name: Checkout selected branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| - name: Show current branch | |
| run: git branch --show-current | |
| - name: Build and Push custom KIND node image | |
| run: | | |
| hack/print-workspace-status.sh | |
| kind build node-image --image ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} . | |
| docker push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} |