mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-25 17:12:50 +00:00
Signed-off-by: joyceliu <joyceliu@yunify.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: BuildContainerImage
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v4*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'kubesphere/kubekey'
|
|
env:
|
|
GO111MODULE: on
|
|
steps:
|
|
- name: Prepare
|
|
id: prepare
|
|
run: |
|
|
VERSION=latest
|
|
|
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
fi
|
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Login to DOCKER
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Set up Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push Docker images
|
|
run: |
|
|
tag=${{ steps.prepare.outputs.version }}
|
|
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
REGISTRY=docker.io/kubesphere TAG=$tag make docker-build
|
|
else
|
|
REGISTRY=docker.io/kubespheredev TAG=$tag make docker-build
|
|
fi
|