-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (50 loc) · 1.52 KB
/
build-and-push-image.yaml
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
# Builds and pushes docker images on main and tags
name: Build and Push Docker image
on:
push:
branches:
- main
tags:
- '*'
jobs:
build:
if: github.repository == 'geoserver/geoserver-acl'
name: Build and Push
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# Add support for more platforms with QEMU
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/setup-buildx-action
with:
platforms: linux/amd64,linux/arm64
# Sets up docker build command as an alias to docker buildx
install: true
- name: Package
run: make package
- name: Set version tag
run: echo "TAG=$(./mvnw help:evaluate -q -DforceStdout -Dexpression=project.version)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: ./src/artifacts/api
tags: geoservercloud/geoserver-acl:${{ env.TAG }}