updates #5
Workflow file for this run
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
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 |