Skip to content

Commit

Permalink
Update dockerimage.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon authored Jan 8, 2021
1 parent 227aea9 commit 88b5210
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
workflow_dispatch:

env:
DOCKER_BUILDX_PLATFORM: linux/amd64,linux/arm/v7,linux/arm64

jobs:

build:
Expand Down Expand Up @@ -41,7 +44,7 @@ jobs:
docker buildx create --name builder --use
docker buildx inspect --bootstrap
docker buildx build . \
--platform linux/amd64,linux/arm/v7,linux/arm64
--platform "${{ env.DOCKER_BUILDX_PLATFORM }}"
- name: login to docker hub
if: ${{ env.GITHUB_BRANCH == 'master' || startsWith(env.GITHUB_TAG, 'v') }}
Expand All @@ -54,7 +57,7 @@ jobs:
env:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
DOCKER_REPOSITORY="${GITHUB_REPOSITORY}"
DOCKER_REPOSITORY="$GITHUB_REPOSITORY"
DOCKER_TAGS=()
if [ "${GITHUB_BRANCH}" ]
Expand All @@ -68,12 +71,12 @@ jobs:
elif [[ "$GITHUB_TAG" = v* ]]
then
VERSION=${GITHUB_TAG#v}
VERSION_PARTS=($(echo VERSION | tr "." "\n"))
VERSION_PARTS=($(echo $VERSION | tr "." "\n"))
DOCKER_TAGS=($VERSION ${VERSION_PARTS[1]})
fi
echo "image tag(s):"
printf " ${DOCKER_REPOSITORY}:%s\n" "${DOCKER_TAGS[@]}"
docker buildx build --push . \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
--platform "${{ env.DOCKER_BUILDX_PLATFORM }}" \
${DOCKER_TAGS[@]/#/--tag ${DOCKER_REPOSITORY}:}

0 comments on commit 88b5210

Please sign in to comment.