mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-21 14:22:24 +00:00
This is a suggestion from Choi, so we can easily test with a specific kubectl version and also easily understand which kubectl version is being used in case of failure. Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: Build kubectl multi-arch image
|
|
|
|
on:
|
|
schedule:
|
|
# Run every Sunday at 00:00 UTC
|
|
- cron: '0 0 * * 0'
|
|
workflow_dispatch:
|
|
# Allow manual triggering
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'tools/packaging/kubectl/Dockerfile'
|
|
- '.github/workflows/build-kubectl-image.yaml'
|
|
|
|
permissions: {}
|
|
|
|
env:
|
|
REGISTRY: quay.io
|
|
IMAGE_NAME: kata-containers/kubectl
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build and push multi-arch image
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
|
|
|
- name: Login to Quay.io
|
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
|
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
|
|
|
- name: Get kubectl version
|
|
id: kubectl-version
|
|
run: |
|
|
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
|
|
echo "version=${KUBECTL_VERSION}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Generate image metadata
|
|
id: meta
|
|
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
tags: |
|
|
type=raw,value=latest
|
|
type=raw,value={{date 'YYYYMMDD'}}
|
|
type=raw,value=${{ steps.kubectl-version.outputs.version }}
|
|
type=sha,prefix=
|
|
|
|
- name: Build and push multi-arch image
|
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
|
|
with:
|
|
context: tools/packaging/kubectl/
|
|
file: tools/packaging/kubectl/Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|