2.7.1/aliyun#7
Open
chongyuanyin wants to merge 2 commits into
Open
Conversation
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 |
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: registry-intl.cn-shanghai.aliyuncs.com |
Comment on lines
+118
to
+196
| name: push multi-arch manifest for ecp-ai | ||
| runs-on: ubuntu-22.04 | ||
| needs: [build-docker-images] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Check latest image | ||
| id: latest | ||
| run: | | ||
| echo "latest=false" >> $GITHUB_OUTPUT | ||
| if echo "${{ github.ref_name }}" |egrep -q "^[0-9].[0-9].[0-9]$"; then | ||
| echo "latest=true" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Cusmoter image tag | ||
| id: customer | ||
| run: | | ||
| tag="${GITHUB_REF##*/}" | ||
| echo "tag=$tag" >> $GITHUB_OUTPUT | ||
| - uses: docker/metadata-action@v4 | ||
| id: meta | ||
| with: | ||
| images: ghcr.io/emqxecp/ecp-ai | ||
| flavor: | | ||
| latest=${{ steps.latest.outputs.latest }} | ||
| tags: | | ||
| type=raw,enable=${{ contains(github.ref_name, 'customer') }},value=${{ steps.customer.outputs.tag }} | ||
| type=ref,event=branch,enable=${{ !contains(github.ref_name, 'customer') }} | ||
| type=ref,event=pr,enable=${{ !contains(github.ref_name, 'customer') }} | ||
| type=ref,event=tag,enable=${{ !contains(github.ref_name, 'customer') }} | ||
| type=semver,pattern={{version}},enable=${{ !contains(github.ref_name, 'customer') }} | ||
| type=semver,pattern={{major}}.{{minor}},enable=${{ !contains(github.ref_name, 'customer') }} | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: registry-intl.cn-shanghai.aliyuncs.com | ||
| username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }} | ||
| password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }} | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ecp-ai-digest-amd64 | ||
| path: digests/amd64 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ecp-ai-digest-arm64 | ||
| path: digests/arm64 | ||
| - name: Create and push multi-arch manifest | ||
| run: | | ||
| amd64=$(cat digests/amd64/ecp-ai-digest.txt) | ||
| arm64=$(cat digests/arm64/ecp-ai-digest.txt) | ||
| readarray -t tags <<< "${{ steps.meta.outputs.tags }}" | ||
| for tag in "${tags[@]}"; do | ||
| docker buildx imagetools create -t "$tag" \ | ||
| ghcr.io/emqxecp/ecp-ai@${amd64} \ | ||
| ghcr.io/emqxecp/ecp-ai@${arm64} | ||
| done | ||
| - name: Push to Aliyun ACR | ||
| run: | | ||
| # Get digest from artifacts | ||
| amd64=$(cat digests/amd64/ecp-ai-digest.txt) | ||
| arm64=$(cat digests/arm64/ecp-ai-digest.txt) | ||
|
|
||
| # Pull amd64 image by digest and push to Aliyun with fixed tag 2.7.1 | ||
| docker pull ghcr.io/emqxecp/ecp-ai@${amd64} | ||
| docker tag ghcr.io/emqxecp/ecp-ai@${amd64} registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1-amd64 | ||
| docker push registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1-amd64 | ||
|
|
||
| # Pull arm64 image by digest and push to Aliyun with fixed tag 2.7.1 | ||
| docker pull ghcr.io/emqxecp/ecp-ai@${arm64} | ||
| docker tag ghcr.io/emqxecp/ecp-ai@${arm64} registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1-arm64 | ||
| docker push registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1-arm64 | ||
|
|
||
| # Create and push multi-arch manifest | ||
| docker manifest create registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1 \ | ||
| registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1-amd64 \ | ||
| registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1-arm64 | ||
| docker manifest push registry-intl.cn-shanghai.aliyuncs.com/bchub/ecp-ai:2.7.1 No newline at end of file |
| run: | | ||
| tag="${GITHUB_REF##*/}" | ||
| echo "tag=$tag" >> $GITHUB_OUTPUT | ||
| - uses: docker/metadata-action@v4 |
| type=ref,event=tag,enable=${{ !contains(github.ref_name, 'customer') }} | ||
| type=semver,pattern={{version}},enable=${{ !contains(github.ref_name, 'customer') }} | ||
| type=semver,pattern={{major}}.{{minor}},enable=${{ !contains(github.ref_name, 'customer') }} | ||
| - uses: docker/login-action@v3 |
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 |
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 |
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 |
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 |
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.EMQXECP_GIT_TOKEN }} | ||
| - uses: docker/login-action@v3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.