-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (49 loc) · 1.5 KB
/
docker-image.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
47
48
49
50
51
52
53
54
55
56
57
58
name: Docker Image CI
on:
push:
branches: master
tags: '*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name : Checkout
uses: actions/checkout@v2
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=mbarre/schemacrawler-additional-lints
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${VERSION}"
else
TAGS="${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS}
- name: Build with Maven
run: mvn install -DskipTests --file pom.xml
- name: Set Up QEMU
uses: docker/setup-qemu-action@v1
- name: Set Up Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push from master
id: docker_build_master
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64, linux/arm64, linux/386
#TODO find a way to inject these values
build-args: |
SCHEMACRAWLER_VERSION=16.10.1
LINTS_VERSION=1.06.11
push: true
tags: ${{ steps.prep.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}