Skip to content

Commit eea61cf

Browse files
authored
support push image to aliyun registry (#16)
Co-authored-by: rick <[email protected]>
1 parent 1bfd4b7 commit eea61cf

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

.github/workflows/release.yaml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,42 +83,27 @@ jobs:
8383
registry: ${{ env.REGISTRY }}
8484
username: ${{ github.actor }}
8585
password: ${{ secrets.GH_PUBLISH_SECRETS }}
86-
- name: Extract Docker metadata
87-
id: meta
88-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
89-
with:
90-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
91-
- name: Build and push Docker image
92-
id: build-and-push
93-
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
94-
with:
95-
context: .
96-
push: ${{ github.event_name != 'pull_request' }}
97-
tags: ${{ steps.meta.outputs.tags }}
98-
labels: ${{ steps.meta.outputs.labels }}
99-
platforms: linux/amd64,linux/arm64
100-
cache-from: type=gha
101-
cache-to: type=gha,mode=max
102-
103-
image-dockerhub:
104-
runs-on: ubuntu-20.04
105-
steps:
106-
- name: Checkout
107-
uses: actions/[email protected]
108-
- name: Setup Docker buildx
109-
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
11086
- name: Log into registry ${{ env.REGISTRY_DOCKERHUB }}
11187
if: github.event_name != 'pull_request'
11288
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
11389
with:
11490
registry: ${{ env.REGISTRY_DOCKERHUB }}
11591
username: linuxsuren
11692
password: ${{ secrets.DOCKER_HUB_PUBLISH_SECRETS }}
93+
- name: Log into registry ${{ env.REGISTRY_ALIYUN }}
94+
if: github.event_name != 'pull_request'
95+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
96+
with:
97+
registry: ${{ env.REGISTRY_ALIYUN }}
98+
username: ${{ env.REGISTRY_ALIYUN_USER }}
99+
password: ${{ secrets.REGISTRY_ALIYUN_PUBLISH_SECRETS }}
117100
- name: Extract Docker metadata
118101
id: meta
119102
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
120103
with:
121-
images: ${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }}
104+
images: |
105+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
106+
${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }}
122107
- name: Build and push Docker image
123108
id: build-and-push
124109
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a

0 commit comments

Comments
 (0)