-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (45 loc) · 1.54 KB
/
build.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
43
44
45
46
name: Build Docker Images
on: [push]
jobs:
build_image:
if: github.ref_name != 'master'
runs-on: ubuntu-latest
steps:
- uses: zendesk/checkout@v2
- name: Set up QEMU
run: |-
QEMU_IMAGE=tonistiigi/binfmt:latest
docker pull $QEMU_IMAGE
docker image inspect $QEMU_IMAGE
docker run --rm --privileged $QEMU_IMAGE --install all
- name: Set up Docker Buildx
id: buildx
uses: zendesk/[email protected]
with:
install: true
- name: Build images
run: |-
set -eu -o pipefail
docker buildx build --platform=linux/arm64,linux/amd64 --file=Dockerfile --tag="zendesk/statsd-logger:latest" .
push_image:
if: github.ref_name == 'master'
runs-on: ubuntu-latest
steps:
- uses: zendesk/checkout@v2
- name: Set up QEMU
run: |-
QEMU_IMAGE=tonistiigi/binfmt:latest
docker pull $QEMU_IMAGE
docker image inspect $QEMU_IMAGE
docker run --rm --privileged $QEMU_IMAGE --install all
- name: Set up Docker Buildx
id: buildx
uses: zendesk/[email protected]
with:
install: true
- name: Push images
run: |-
set -eu -o pipefail
echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login --username=${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
set -x
docker buildx build --push --platform=linux/arm64,linux/amd64 --file=Dockerfile --tag="zendesk/statsd-logger:latest" .