Build Image #44
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 Image | |
on: | |
workflow_dispatch: | |
inputs: | |
kubernetesDebVersion: | |
description: "Kubernetes Deb Version" | |
required: true | |
kubernetesRPMVersion: | |
description: "Kubernetes RPM Version" | |
required: true | |
kubernetesSemanticVersion: | |
description: "Kubernetes Semantic Version" | |
required: true | |
kubernetesSeries: | |
description: "Kubernetes Series" | |
required: true | |
env: | |
REGISTRY: ghcr.io | |
KUBERNETES_DEB_VERSION: ${{ github.event.inputs.kubernetesDebVersion }} | |
KUBERNETES_RPM_VERSION: ${{ github.event.inputs.kubernetesRPMVersion }} | |
KUBERNETES_SEM_VERSION: ${{ github.event.inputs.kubernetesSemanticVersion }} | |
KUBERNETES_SERIES: ${{ github.event.inputs.kubernetesSeries }} | |
jobs: | |
buildImage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: kubernetes-sigs/image-builder | |
path: image-builder | |
# Workaround for breaking changes in upstream image-builder that need to be verified | |
# ref: 9eea1153526d37969e96697cb1dacd15e28dbccf | |
- name: Install QEMU | |
run: | | |
sudo apt update | |
sudo -i apt install qemu-system-x86 | |
- name: Build the images | |
run: | | |
export PATH=$PWD/.bin:$PATH | |
cd image-builder/images/capi | |
cat << EOF > packer/raw/overwrite-kubernetes.json | |
{ | |
"accelerator": "tcg", | |
"kubernetes_deb_version": "${KUBERNETES_DEB_VERSION}", | |
"kubernetes_rpm_version": "${KUBERNETES_RPM_VERSION}", | |
"kubernetes_semver": "${KUBERNETES_SEM_VERSION}", | |
"kubernetes_series": "${KUBERNETES_SERIES}" | |
} | |
EOF | |
packer plugins install github.com/hashicorp/qemu | |
make deps-qemu | |
PACKER_VAR_FILES=packer/raw/overwrite-kubernetes.json make build-raw-all | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push the images | |
run: | | |
# oras push ${REGISTRY}/${{ github.repository }}/ubuntu-1804:${KUBERNETES_SEM_VERSION}.gz --manifest-config /dev/null:application/vnd.acme.rocket.config image-builder/images/capi/output/ubuntu-1804-kube-${KUBERNETES_SEM_VERSION}.gz | |
oras push ${REGISTRY}/${{ github.repository }}/ubuntu-2004:${KUBERNETES_SEM_VERSION}.gz --manifest-config /dev/null:application/vnd.acme.rocket.config image-builder/images/capi/output/ubuntu-2004-kube-${KUBERNETES_SEM_VERSION}.gz |