build-kind #23
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: build-kind | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Kubernetes version' | |
default: 'v1.30.0' | |
required: true | |
permissions: | |
contents: read | |
jobs: | |
k8s-node-amd64: | |
runs-on: | |
group: "Default Larger Runners" | |
labels: ubuntu-latest-16-cores | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare | |
id: prep | |
run: | | |
VERSION="${{ github.event.inputs.version }}" | |
if [[ -z "$VERSION" ]]; then | |
VERSION="v1.27.13" | |
fi | |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Setup Kind | |
uses: helm/[email protected] | |
with: | |
version: v0.23.0 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: kubernetes/kubernetes | |
ref: ${{ steps.prep.outputs.VERSION }} | |
path: kubernetes | |
- name: Build node image | |
run: | | |
cd $GITHUB_WORKSPACE/kubernetes | |
kind build node-image | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: fluxcdbot | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Push node image | |
run: | | |
docker tag kindest/node:latest ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-amd64 | |
docker push ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-amd64 | |
k8s-node-arm64: | |
runs-on: | |
group: "ARM64" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare | |
id: prep | |
run: | | |
VERSION="${{ github.event.inputs.version }}" | |
if [[ -z "$VERSION" ]]; then | |
VERSION="v1.27.13" | |
fi | |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Setup Kind | |
uses: helm/[email protected] | |
with: | |
version: v0.23.0 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: kubernetes/kubernetes | |
ref: ${{ steps.prep.outputs.VERSION }} | |
path: kubernetes | |
- name: Build node image | |
run: | | |
cd $GITHUB_WORKSPACE/kubernetes | |
kind build node-image | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: fluxcdbot | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Push node image | |
run: | | |
docker tag kindest/node:latest ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-arm64 | |
docker push ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-arm64 |