From 7e63d4448fdcc7d99e58767057c43b8e56349f73 Mon Sep 17 00:00:00 2001 From: John Niang Date: Tue, 22 Oct 2024 17:37:56 +0800 Subject: [PATCH] Support pushing Docker image into Fit2Cloud Docker Registry (#6921) Signed-off-by: JohnNiang --- .github/actions/docker-buildx-push/action.yaml | 15 +++++++++++++++ .github/workflows/halo.yaml | 2 ++ 2 files changed, 17 insertions(+) diff --git a/.github/actions/docker-buildx-push/action.yaml b/.github/actions/docker-buildx-push/action.yaml index d377b4334..84bf08df5 100644 --- a/.github/actions/docker-buildx-push/action.yaml +++ b/.github/actions/docker-buildx-push/action.yaml @@ -14,6 +14,14 @@ inputs: description: Token for the DockerHub account required: false default: "" + f2c-registry-user: + description: "User name of Fit2Cloud Docker Registry." + required: false + default: "" + f2c-registry-token: + description: "Token of Fit2Cloud Docker Registry." + required: false + default: "" push: description: Should push the docker image or not. required: false @@ -37,6 +45,7 @@ runs: images: | ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }} halohub/${{ inputs.image-name }} + registry.fit2cloud.com/halo/${{ inputs.image-name }} tags: | type=schedule,pattern=nightly-{{date 'YYYYMMDD'}},enabled=${{ github.event_name == 'schedule' }} type=ref,event=branch,enabled=${{ github.event_name == 'push' }} @@ -64,6 +73,12 @@ runs: with: username: ${{ inputs.dockerhub-user }} password: ${{ inputs.dockerhub-token }} + - name: Login to Fit2Cloud Docker Registry + if: inputs.f2c-registry-token != '' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ inputs.f2c-registry-username }} + password: ${{ inputs.f2c-registry-token }} - name: Build and push uses: docker/build-push-action@v5 with: diff --git a/.github/workflows/halo.yaml b/.github/workflows/halo.yaml index b83bae4ab..660a9a65f 100644 --- a/.github/workflows/halo.yaml +++ b/.github/workflows/halo.yaml @@ -98,6 +98,8 @@ jobs: ghcr-token: ${{ secrets.GITHUB_TOKEN }} dockerhub-user: ${{ secrets.DOCKER_USERNAME }} dockerhub-token: ${{ secrets.DOCKER_TOKEN }} + f2c-registry-user: ${{ secrets.F2C_REGISTRY_USER }} + f2c-registry-token: ${{ secrets.F2C_REGISTRY_TOKEN }} push: true platforms: linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x