@@ -7,7 +7,7 @@ on: [push, pull_request]
7
7
8
8
jobs :
9
9
build :
10
- name : Lint the codebase
10
+ name : Lint the codebase, build and test the image
11
11
runs-on : ubuntu-20.04
12
12
steps :
13
13
@@ -22,24 +22,25 @@ jobs:
22
22
uses : docker/setup-buildx-action@v1
23
23
- name : Set up QEMU
24
24
uses : docker/setup-qemu-action@v1
25
- - name : Build the container image for x86_64 only
25
+ - name : Build the container image for x86_64 to get early feedback
26
26
uses : docker/build-push-action@v2
27
27
with :
28
28
context : .
29
29
file : ./Dockerfile
30
30
platforms : linux/amd64
31
31
push : false
32
32
tags : ${{ env.CONTAINER_IMAGE_TAG }}
33
- - name : Test the container image
34
- shell : bash
35
- run : docker run ${{ env.CONTAINER_IMAGE_TAG }}
36
33
deploy :
37
34
environment : Docker Hub
38
35
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
39
36
name : Deploy the container image
40
37
needs : build
41
38
runs-on : ubuntu-20.04
42
39
steps :
40
+ - name : Setup Docker Buildx
41
+ uses : docker/setup-buildx-action@v1
42
+ - name : Set up QEMU
43
+ uses : docker/setup-qemu-action@v1
43
44
- name : Login to Docker Hub
44
45
uses : docker/login-action@v1
45
46
with :
53
54
platforms : linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
54
55
push : true
55
56
tags : ${{ env.CONTAINER_IMAGE_TAG }}
57
+ - name : Test the container image
58
+ shell : bash
59
+ run : docker run ${{ env.CONTAINER_IMAGE_TAG }}
0 commit comments