Skip to content

Commit 6f84dc7

Browse files
Roland SchillingRoland Schilling
authored andcommitted
Building images using Buildkit for amd64 and arm64
1 parent 97c758f commit 6f84dc7

1 file changed

Lines changed: 21 additions & 34 deletions

File tree

.github/workflows/main.yml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,38 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
17-
- name: Log in to Docker Hub
18-
uses: docker/login-action@v2
17+
- name: setup qemu for multi-arch build
18+
uses: docker/setup-qemu-action@v2
1919
with:
20-
#registry: registry.hub.docker.com
21-
username: wurstbrot
22-
password: ${{ secrets.HUB_TOKEN }}
23-
- name: create and push an image
20+
platforms: amd64,arm64
21+
- name: setup buildx
22+
uses: docker/setup-buildx-action@v2
23+
- name: create version string
24+
id: version
2425
run: |
2526
if [ "${GITHUB_REF##*/}" == "master" ]; then
26-
VERSION="3.0.0-${GITHUB_RUN_NUMBER}"
27+
echo "VERSION=3.0.0-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
2728
else
2829
BRANCH_TO_DOCKER=$(echo ${GITHUB_REF##*/} | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]//g')
29-
VERSION="${BRANCH_TO_DOCKER}-${GITHUB_RUN_NUMBER}"
30+
echo "VERSION=${BRANCH_TO_DOCKER}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
3031
fi
31-
docker build -t wurstbrot/dsomm-yaml-generation:latest -f Dockerfile-yaml .
32-
docker push wurstbrot/dsomm-yaml-generation:latest
33-
docker tag wurstbrot/dsomm-yaml-generation:latest wurstbrot/dsomm-yaml-generation:${VERSION}
34-
docker push wurstbrot/dsomm-yaml-generation:${VERSION}
3532
- name: Log in to Docker Hub
3633
uses: docker/login-action@v2
3734
with:
3835
#registry: registry.hub.docker.com
3936
username: wurstbrot
4037
password: ${{ secrets.HUB_TOKEN }}
41-
- name: setup qemu for multi-arch build
42-
uses: docker/setup-qemu-action@v1
43-
- name: setup buildx
44-
id: buildx
45-
uses: docker/setup/buildx-action@v1
46-
- name: create version string
47-
id: version
48-
run: |
49-
if [ "${GITHUB_REF##*/}" == "master" ]; then
50-
VERSION="3.0.0-${GITHUB_RUN_NUMBER}"
51-
else
52-
BRANCH_TO_DOCKER=$(echo ${GITHUB_REF##*/} | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]//g')
53-
VERSION="${BRANCH_TO_DOCKER}-${GITHUB_RUN_NUMBER}"
54-
fi
55-
- name: create and push an image
56-
uses: docker/build-push-action@v2
38+
- name: create and push yaml image
39+
uses: docker/build-push-action@v3
40+
with:
41+
file: Dockerfile-yaml
42+
push: false
43+
platforms: linux/amd64,linux/arm64
44+
tags: wurstbrot/dsomm-yaml-generation:${{ env.VERSION }},wurstbrot/dsomm-yaml-generation:latest
45+
- name: create and push dsomm image
46+
uses: docker/build-push-action@v3
5747
with:
58-
context: .
59-
push: true
60-
platforms: linux/amd64,linux/arm64,linux/arm/v7
61-
tags:
62-
- wurstbrot/dsomm:${VERSION}
63-
- wurstbrot/dsomm:lastest
48+
push: false
49+
platforms: linux/amd64,linux/arm64
50+
tags: wurstbrot/dsomm:${{ env.VERSION }},wurstbrot/dsomm:latest
6451

0 commit comments

Comments
 (0)