Skip to content

fix: kcctl add kcServerHealthCheckTimeout flag to speicfy health chec… #125

fix: kcctl add kcServerHealthCheckTimeout flag to speicfy health chec…

fix: kcctl add kcServerHealthCheckTimeout flag to speicfy health chec… #125

name: build-kc-image
on:
push:
branches:
- 'master'
tags:
- 'v*'
jobs:
build:
name: build-kc-image
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract Tag
id: extract_tag
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Docker login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- name: Run buildx
run: |
tag=latest
if [[ "${{ steps.extract_branch.outputs.branch }}" == "master" ]];then
tag=latest
elif [[ "${{ steps.extract_tag.outputs.version }}" == v* ]]; then
tag="${{ steps.extract_tag.outputs.version }}"
fi
echo extract_tag ${{ steps.extract_tag.outputs.version }}
echo extract_branch ${{ steps.extract_branch.outputs.branch }}
echo current tag is ${tag}
docker buildx build --platform linux/amd64,linux/arm64 --push --file ./Dockerfile -t kubeclipper/kc-server:${tag} .