-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (32 loc) · 1.2 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build docker and push
on:
push:
branches:
- 'main'
env:
IMAGE_NAME: larmic/abfallkalender_api
jobs:
build:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: prepare buildx
run: |
# Use docker-container driver to allow useful features (push/multi-platform)
docker buildx create --driver docker-container --use
docker buildx inspect --bootstrap
- name: build and push image
run: |
update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
docker buildx build --platform=linux/amd64,linux/arm64,linux/arm --build-arg VERSION=$VERSION --pull --tag "$IMAGE_NAME:$VERSION" --tag "$IMAGE_NAME:latest" . --push