chore(CI): using docker official actions for build packages workflow
Signed-off-by: zhanghongtong <rory-z@outlook.com>
This commit is contained in:
parent
3f1d3b9cf4
commit
c90fc9578e
|
@ -356,49 +356,50 @@ jobs:
|
|||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -q source-${{ matrix.otp }}.zip
|
||||
- name: get version
|
||||
id: version
|
||||
working-directory: source
|
||||
run: echo "::set-output name=version::$(./pkg-vsn.sh)"
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
image: tonistiigi/binfmt:latest
|
||||
platforms: all
|
||||
- name: build emqx docker image
|
||||
- uses: docker/build-push-action@v2
|
||||
if: github.event_name != 'release'
|
||||
env:
|
||||
ERL_OTP: erl${{ matrix.otp }}
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
working-directory: source
|
||||
run: |
|
||||
PKG_VSN="$(./pkg-vsn.sh)"
|
||||
docker buildx build --no-cache \
|
||||
--platform=linux/amd64,linux/arm64 \
|
||||
--build-arg PKG_VSN=$PKG_VSN \
|
||||
--build-arg BUILD_FROM=emqx/build-env:$ERL_OTP-alpine \
|
||||
--build-arg RUN_FROM=alpine:3.14 \
|
||||
--build-arg EMQX_NAME=$PROFILE \
|
||||
--tag emqx/$PROFILE:$PKG_VSN \
|
||||
-f deploy/docker/Dockerfile .
|
||||
with:
|
||||
push: false
|
||||
pull: true
|
||||
no-cache: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: emqx/${{ matrix.profile }}:${{ steps.version.outputs.version }}
|
||||
build-args: |
|
||||
PKG_VSN=${{ steps.version.outputs.version }}
|
||||
BUILD_FROM=emqx/build-env:erl${{ matrix.otp }}-alpine
|
||||
RUN_FROM=alpine:3.14
|
||||
EMQX_NAME=${{ matrix.profile }}
|
||||
file: source/deploy/docker/Dockerfile
|
||||
context: source
|
||||
- uses: docker/login-action@v1
|
||||
if: github.event_name == 'release'
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
- name: build emqx docker image
|
||||
- uses: docker/build-push-action@v2
|
||||
if: github.event_name == 'release'
|
||||
env:
|
||||
ERL_OTP: erl${{ matrix.otp }}
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
working-directory: source
|
||||
run: |
|
||||
PKG_VSN="$(./pkg-vsn.sh)"
|
||||
docker buildx build --no-cache \
|
||||
--platform=linux/amd64,linux/arm64 \
|
||||
--build-arg PKG_VSN=$PKG_VSN \
|
||||
--build-arg BUILD_FROM=emqx/build-env:$ERL_OTP-alpine \
|
||||
--build-arg RUN_FROM=alpine:3.14 \
|
||||
--build-arg EMQX_NAME=$PROFILE \
|
||||
--tag emqx/$PROFILE:$PKG_VSN \
|
||||
-f deploy/docker/Dockerfile \
|
||||
--push .
|
||||
with:
|
||||
push: true
|
||||
pull: true
|
||||
no-cache: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: emqx/${{ matrix.profile }}:${{ steps.version.outputs.version }}
|
||||
build-args: |
|
||||
PKG_VSN=${{ steps.version.outputs.version }}
|
||||
BUILD_FROM=emqx/build-env:erl${{ matrix.otp }}-alpine
|
||||
RUN_FROM=alpine:3.14
|
||||
EMQX_NAME=${{ matrix.profile }}
|
||||
file: source/deploy/docker/Dockerfile
|
||||
context: source
|
||||
|
||||
delete-artifact:
|
||||
|
||||
|
|
Loading…
Reference in New Issue