Browse Source

feat: 同时将镜像推送到国内阿里仓库,解决镜像下载问题 (#258)

二丫讲梵 1 year ago
parent
commit
60e1c43483
1 changed files with 19 additions and 1 deletions
  1. 19 1
      .github/workflows/docker-image.yml

+ 19 - 1
.github/workflows/docker-image.yml

@@ -77,4 +77,22 @@ jobs:
       #     platforms: linux/amd64,linux/arm64
       #     tags: |
       #       ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:${{ env.GITHUB_REF_NAME }}
-      #       ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:latest
+      #       ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:latest
+
+      # 镜像推送到 阿里云仓库
+      - name: Login to the GitHub Container Registry
+        uses: docker/login-action@v2
+        with:
+          registry: registry.cn-hangzhou.aliyuncs.com
+          username: ${{ secrets.ALIHUB_USERNAME }}
+          password: ${{ secrets.ALIHUB_TOKEN }}
+
+      - name: Build and push image:latest
+        uses: docker/build-push-action@v3
+        with:
+          context: .
+          push: true
+          platforms: linux/amd64,linux/arm64
+          tags: |
+            registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIHUB_USERNAME }}/chatgpt-dingtalk:${{ env.GITHUB_REF_NAME }}
+            registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIHUB_USERNAME }}/chatgpt-dingtalk:latest