-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c10f9e9
commit d02c8d6
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
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-geoblacklight-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- 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 geobalcklight Docker image | ||
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 }} | ||
|
||
# On push to main | ||
- name: Build and push branch Docker image | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
FROM docker.osgeo.org/geoserver:2.25.3 | ||
ARG VERSION=2.25.3 | ||
FROM docker.osgeo.org/geoserver:$VERSION | ||
RUN rm -rf $GEOSERVER_DATA_DIR | ||
ADD geoserver_data/ /opt/geoserver_data/ |