From 504fc47ede781efab01fffbba468209b74a0a929 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Sun, 21 Apr 2024 10:45:49 +0300 Subject: [PATCH] Build KinD node image for AMD64 Runs on GitHub ubuntu-latest-16-cores Signed-off-by: Stefan Prodan --- .github/workflows/build-kind.yaml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build-kind.yaml diff --git a/.github/workflows/build-kind.yaml b/.github/workflows/build-kind.yaml new file mode 100644 index 0000000..f39224d --- /dev/null +++ b/.github/workflows/build-kind.yaml @@ -0,0 +1,54 @@ +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: 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