-
Notifications
You must be signed in to change notification settings - Fork 5
112 lines (98 loc) · 3.81 KB
/
build-docker-images.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build docker images
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
BRANCH: ${{ github.head_ref || github.ref_name }}
jobs:
build-geoserver-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get geoserver version from dockerfile
id: package_version
run: echo "version=$(grep -Pio '(?<=ARG VERSION=).*' ./geoserver/Dockerfile)" >> $GITHUB_OUTPUT
# On pull request
- name: Build and push GeoServer Docker image with version tag
uses: docker/build-push-action@v6
if: github.event_name == 'pull_request'
with:
context: "${{ github.workspace }}/geoserver/"
file: "${{ github.workspace }}/geoserver/Dockerfile"
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/geoblacklight/geoserver:${{ steps.package_version.outputs.version }}-dev
# On push to main
- name: Build and push GeoServer Docker image with version and latest tags
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
with:
context: "${{ github.workspace }}/geoserver/"
file: "${{ github.workspace }}/geoserver/Dockerfile"
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/geoblacklight/geoserver:${{ steps.package_version.outputs.version }}
ghcr.io/geoblacklight/geoserver:latest
build-solr-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get solr version from dockerfile
id: package_version
run: echo "version=$(grep -Pio '(?<=ARG VERSION=).*' ./solr/Dockerfile)" >> $GITHUB_OUTPUT
# On pull request
- name: Build and push Solr Docker image with version tag
uses: docker/build-push-action@v6
if: github.event_name == 'pull_request'
with:
context: "${{ github.workspace }}/solr/"
file: "${{ github.workspace }}/solr/Dockerfile"
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/geoblacklight/solr:${{ steps.package_version.outputs.version }}-dev
# On push to main
- name: Build and push Solr Docker image with version and latest tags
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
with:
context: "${{ github.workspace }}/solr/"
file: "${{ github.workspace }}/solr/Dockerfile"
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/geoblacklight/solr:${{ steps.package_version.outputs.version }}
ghcr.io/geoblacklight/solr:latest