Skip to content

Embed PostGIS version 3.4 (#495) #54

Embed PostGIS version 3.4 (#495)

Embed PostGIS version 3.4 (#495) #54

Workflow file for this run

name: Docker image
on:
push:
branches:
- 'master'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: Build & push docker image
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
psql: [12,13,14,15,16]
postgis: [3.4]
os: [ubuntu-latest]
env:
IMG_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Extract highest version
id: extract-highest-version
if: ${{ matrix.psql == '16' && github.ref_type == 'tag' }}
run: |
# List tags and store the result in a variable
TAGS=$(git ls-remote --tags origin)
# Extract major.minor version numbers from tags and store them in an array
VERSIONS=()
while read -r line; do
tag=$(echo "$line" | cut -d"/" -f3)
version=$(echo "$tag" | cut -d"v" -f2)
major=$(echo "$version" | cut -d"." -f1)
minor=$(echo "$version" | cut -d"." -f2)
VERSIONS+=("$major.$minor")
done <<< "$TAGS"
# Sort the array to find the highest version
IFS=$'\n' sorted=($(sort -rV <<<"${VERSIONS[*]}"))
# Output the highest version
echo "highest-version=v${sorted[0]}" >> "$GITHUB_OUTPUT"
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: mobilitydb/mobilitydb
# generate Docker tags based on the following events/attributes
flavor: |

Check failure on line 57 in .github/workflows/docker-image.yaml

View workflow run for this annotation

GitHub Actions / Docker image

Invalid workflow file

The workflow is not valid. .github/workflows/docker-image.yaml (Line: 57, Col: 19): Unexpected end of expression: 'highest-version'. Located at position 116 within expression: matrix.psql == '16' && github.ref_type == 'tag' && contains(github.ref_name, steps.extract-highest-version.outputs.highest-version
latest=${{ matrix.psql == '16' && github.ref_type == 'tag' && contains(github.ref_name, steps.extract-highest-version.outputs.highest-version}}
prefix=${{ matrix.psql }}-${{ matrix.postgis }}-
tags: |
type=ref,event=branch
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# Add linux/arm64 when postgis builds arm64 version
platforms: linux/amd64
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
# Add linux/arm64 when postgis builds arm64 version
platforms: linux/amd64
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
POSTGRES_VERSION=${{ matrix.psql }}
POSTGIS_VERSION=${{ matrix.postgis }}
MOBILITYDB_TAG=${{ github.ref_name }}