change docker repo by tags Signed-off-by: liujian <54946465+redscholar@users.noreply.github.com>
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: BuildContainerImage
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'release-*'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
- 'release-*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GO111MODULE: on
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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
|
|
if: github.event_name == 'push'
|
|
run: |
|
|
tag=${GITHUB_REF#refs/*/}
|
|
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
REGISTRY=docker.io/kubesphere TAG=$tag make container-cross-push
|
|
else
|
|
REGISTRY=docker.io/kubespheredev TAG=$tag make container-cross-push
|
|
fi
|
|
|