chore(mix): split elixir docker image build into separate step
This commit is contained in:
parent
9c68f4bd11
commit
a974221ffa
|
@ -446,6 +446,14 @@ jobs:
|
||||||
arch:
|
arch:
|
||||||
- amd64
|
- amd64
|
||||||
- arm64
|
- arm64
|
||||||
|
build_elixir:
|
||||||
|
- no_elixir
|
||||||
|
include:
|
||||||
|
- profile: emqx
|
||||||
|
otp: 24.1.5-3
|
||||||
|
elixir: 1.13.1
|
||||||
|
arch: amd64
|
||||||
|
build_elixir: with_elixir
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
@ -461,6 +469,7 @@ jobs:
|
||||||
platforms: all
|
platforms: all
|
||||||
- uses: docker/metadata-action@v3
|
- uses: docker/metadata-action@v3
|
||||||
id: meta
|
id: meta
|
||||||
|
if: ${{ matrix.build_elixir == 'no_elixir' }}
|
||||||
with:
|
with:
|
||||||
images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
||||||
flavor: |
|
flavor: |
|
||||||
|
@ -474,7 +483,7 @@ jobs:
|
||||||
org.opencontainers.image.otp.version=${{ matrix.otp }}
|
org.opencontainers.image.otp.version=${{ matrix.otp }}
|
||||||
- name: docker metadata for elixir image
|
- name: docker metadata for elixir image
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@v3
|
||||||
if: ${{ matrix.profile == 'emqx' }}
|
if: ${{ matrix.build_elixir == 'with_elixir' }}
|
||||||
id: meta-elixir
|
id: meta-elixir
|
||||||
with:
|
with:
|
||||||
images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
||||||
|
@ -486,7 +495,7 @@ jobs:
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
labels:
|
labels: |
|
||||||
org.opencontainers.image.otp.version=${{ matrix.otp }}
|
org.opencontainers.image.otp.version=${{ matrix.otp }}
|
||||||
org.opencontainers.image.elixir.version=${{ matrix.elixir }}
|
org.opencontainers.image.elixir.version=${{ matrix.elixir }}
|
||||||
- uses: docker/login-action@v1
|
- uses: docker/login-action@v1
|
||||||
|
@ -496,7 +505,7 @@ jobs:
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
- uses: docker/build-push-action@v2
|
- uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
|
push: ${{ github.event_name == 'release' && !github.event.release.prerelease && matrix.build_elixir == 'no_elixir' }}
|
||||||
pull: true
|
pull: true
|
||||||
no-cache: true
|
no-cache: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
@ -512,7 +521,7 @@ jobs:
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
if: ${{ matrix.profile == 'emqx' }}
|
if: ${{ matrix.profile == 'emqx' }}
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
|
push: ${{ github.event_name == 'release' && !github.event.release.prerelease && matrix.build_elixir == 'with_elixir' }}
|
||||||
pull: true
|
pull: true
|
||||||
no-cache: true
|
no-cache: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
@ -531,7 +540,7 @@ jobs:
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
||||||
- name: Push image to aws ecr
|
- name: Push image to aws ecr
|
||||||
if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx'
|
if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx' && matrix.build_elixir == 'no_elixir'
|
||||||
run: |
|
run: |
|
||||||
version=${GITHUB_REF##*/}
|
version=${GITHUB_REF##*/}
|
||||||
docker pull emqx/emqx:${version#v}
|
docker pull emqx/emqx:${version#v}
|
||||||
|
@ -539,7 +548,7 @@ jobs:
|
||||||
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
|
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}
|
docker push public.ecr.aws/emqx/emqx:${version#v}
|
||||||
- name: Push image to aws ecr (elixir)
|
- name: Push image to aws ecr (elixir)
|
||||||
if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx'
|
if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx' && matrix.build_elixir == 'with_elixir'
|
||||||
run: |
|
run: |
|
||||||
version=${GITHUB_REF##*/}-elixir
|
version=${GITHUB_REF##*/}-elixir
|
||||||
docker pull emqx/emqx:${version#v}
|
docker pull emqx/emqx:${version#v}
|
||||||
|
|
Loading…
Reference in New Issue