ci(build_packages): push muilt arch image for aws ecr
This commit is contained in:
parent
ca5c34ba96
commit
c316cc464f
|
@ -338,6 +338,11 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
||||||
|
registry:
|
||||||
|
- 'docker.io'
|
||||||
|
include:
|
||||||
|
- profile: emqx
|
||||||
|
registry: 'public.ecr.aws'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
@ -351,10 +356,24 @@ jobs:
|
||||||
with:
|
with:
|
||||||
image: tonistiigi/binfmt:latest
|
image: tonistiigi/binfmt:latest
|
||||||
platforms: all
|
platforms: all
|
||||||
|
- uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
if: matrix.repository == 'public.ecr.aws'
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
||||||
|
- name: Push image to aws ecr
|
||||||
|
if: matrix.repository == 'public.ecr.aws'
|
||||||
|
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
|
||||||
|
- uses: docker/login-action@v1
|
||||||
|
if: matrix.repository == 'docker.io'
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
- uses: docker/metadata-action@v3
|
- uses: docker/metadata-action@v3
|
||||||
id: meta
|
id: meta
|
||||||
with:
|
with:
|
||||||
images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
images: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ matrix.profile }}
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=${{ !github.event.release.prerelease }}
|
latest=${{ !github.event.release.prerelease }}
|
||||||
tags: |
|
tags: |
|
||||||
|
@ -363,11 +382,6 @@ jobs:
|
||||||
type=match,pattern=[v|e](.*),group=1
|
type=match,pattern=[v|e](.*),group=1
|
||||||
labels:
|
labels:
|
||||||
org.opencontainers.image.otp.version=${{ matrix.otp }}
|
org.opencontainers.image.otp.version=${{ matrix.otp }}
|
||||||
- uses: docker/login-action@v1
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
||||||
- uses: docker/build-push-action@v2
|
- uses: docker/build-push-action@v2
|
||||||
if: matrix.profile != 'emqx-ee'
|
if: matrix.profile != 'emqx-ee'
|
||||||
with:
|
with:
|
||||||
|
@ -398,20 +412,6 @@ jobs:
|
||||||
EMQX_NAME=${{ matrix.profile }}
|
EMQX_NAME=${{ matrix.profile }}
|
||||||
file: source/deploy/docker/Dockerfile.enterprise
|
file: source/deploy/docker/Dockerfile.enterprise
|
||||||
context: source
|
context: source
|
||||||
- uses: aws-actions/configure-aws-credentials@v1
|
|
||||||
if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx'
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
||||||
- name: Push image to aws ecr
|
|
||||||
if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx'
|
|
||||||
run: |
|
|
||||||
version=${GITHUB_REF##*/}
|
|
||||||
docker pull emqx/emqx:${version#v}
|
|
||||||
docker tag emqx/emqx:${version#v} public.ecr.aws/emqx/emqx:${version#v}
|
|
||||||
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
|
|
||||||
docker push public.ecr.aws/emqx/emqx:${version#v}
|
|
||||||
|
|
||||||
delete-artifact:
|
delete-artifact:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
Loading…
Reference in New Issue