Skip to content

Change testing to use docker compose #71

Change testing to use docker compose

Change testing to use docker compose #71

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ master ]
jobs:
build:
strategy:
max-parallel: 2
fail-fast: false
matrix:
version: [ 2.24, 2.23, 2.22, 2.21, '2.20', 2.19, 2.18, 2.17, 2.16, 2.15 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: docker build ${{ matrix.version }}
run: docker build ${{ matrix.version }} --tag meteofi/geoserver:${{ matrix.version }} --tag meteofi/geoserver:$(grep -Po '(?<=GEOSERVER_VERSION\=\")\d.\d+.\d+' ${{ matrix.version }}/Dockerfile)
- if: ${{ matrix.version == '2.24' }}
name: docker tag latest stable
run: |
docker tag meteofi/geoserver:${{ matrix.version }} meteofi/geoserver:latest
docker tag meteofi/geoserver:${{ matrix.version }} meteofi/geoserver:stable
- if: ${{ matrix.version == '2.23' }}
name: docker tag maintenance
run: docker tag meteofi/geoserver:${{ matrix.version }} meteofi/geoserver:maintenance
- name: docker test
run: |
cd ${{ matrix.version }}
docker compose up -d --wait --wait-timeout 300
curl -f "http://localhost:8080/geoserver/wms?request=getCapabilities&service=WMS" || exit 1
docker logs geoserver
docker compose down
- name: docker push ${{ matrix.version }}
run: docker push --all-tags meteofi/geoserver