Skip to content

Commit ed9b8f9

Browse files
authored
Merge pull request #170 from akkeris/supports-arm64-builds
Supports arm64 builds
2 parents 4fb7f7d + 7cbe7c2 commit ed9b8f9

File tree

1 file changed

+49
-9
lines changed

1 file changed

+49
-9
lines changed

.github/workflows/dockerimage.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,54 @@ on:
33
release:
44
types: [published]
55
jobs:
6-
build:
6+
docker:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@master
10-
- name: Publish to Registry
11-
uses: elgohr/Publish-Docker-Github-Action@master
12-
with:
13-
name: akkeris/ui
14-
username: ${{ secrets.DockerUser }}
15-
password: ${{ secrets.DockerPassword }}
16-
tag_names: true
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
12+
- name: Prepare
13+
id: prep
14+
run: |
15+
DOCKER_IMAGE=akkeris/ui
16+
VERSION=latest
17+
SHORTREF=${GITHUB_SHA::8}
18+
# If this is git tag, use the tag name as a docker tag
19+
if [[ $GITHUB_REF == refs/tags/* ]]; then
20+
VERSION=${GITHUB_REF#refs/tags/}
21+
fi
22+
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
23+
# If the VERSION looks like a version number, assume that
24+
# this is the most recent version of the image and also
25+
# tag it 'latest'.
26+
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
27+
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
28+
fi
29+
# Set output parameters.
30+
echo ::set-output name=tags::${TAGS}
31+
echo ::set-output name=docker_image::${DOCKER_IMAGE}
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@master
34+
with:
35+
platforms: all
36+
37+
- name: Set up Docker Buildx
38+
id: buildx
39+
uses: docker/setup-buildx-action@master
40+
41+
- name: Login to DockerHub
42+
if: github.event_name != 'pull_request'
43+
uses: docker/login-action@v1
44+
with:
45+
username: ${{ secrets.DockerUser }}
46+
password: ${{ secrets.DockerPassword }}
47+
48+
- name: Build
49+
uses: docker/build-push-action@v2
50+
with:
51+
builder: ${{ steps.buildx.outputs.name }}
52+
context: .
53+
file: ./Dockerfile
54+
platforms: linux/amd64,linux/arm64
55+
push: true
56+
tags: ${{ steps.prep.outputs.tags }}

0 commit comments

Comments
 (0)