push difference docker repo by tags (#6161)
change docker repo by tags Signed-off-by: liujian <54946465+redscholar@users.noreply.github.com>
This commit is contained in:
22
.github/workflows/build-multiarch.yaml
vendored
22
.github/workflows/build-multiarch.yaml
vendored
@@ -24,19 +24,27 @@ jobs:
|
||||
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@v1
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: Set up Docker buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push docker images
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
REPO=kubespheredev TAG="${GITHUB_REF#refs/*/}" make container-cross-push
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user