Skip to content

Commit

Permalink
Updating CI with following docker-postgis Makefile
Browse files Browse the repository at this point in the history
Comment out matrix to match existing folders for test
  • Loading branch information
sanak committed Feb 3, 2025
1 parent 0935532 commit 96d5b92
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: Docker pgRouting CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
schedule:
- cron: '15 5 * * 1'

Expand All @@ -20,38 +14,40 @@ jobs:
make-docker-images:
strategy:
matrix:
postgres: [12, 13, 14, 15, 16, 17]
postgis: [3.4, 3.5]
pgrouting: [develop, main, 3.5, 3.6, 3.7]
postgres: [16] # [12, 13, 14, 15, 16, 17]
postgis: [3.4] # [3.4, 3.5]
pgrouting: [3.5, 3.6] # [develop, main, 3.5, 3.6, 3.7]
# exclude:
# - postgres: 12
# pgrouting: 3.7
# - postgres: 12
# pgrouting: main
# - postgres: 12
# pgrouting: develop

name: Build Docker image for ${{ matrix.postgres }}-${{ matrix.postgis }}-${{ matrix.pgrouting }}
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.pgrouting == 'develop' }}
continue-on-error: ${{ (matrix.pgrouting == 'develop') || (matrix.pgrouting == 'main') }}
env:
POSTGRES_VERSION: ${{ matrix.postgres }}
POSTGIS_VERSION: ${{ matrix.postgis }}
PGROUTING_VERSION: ${{ matrix.pgrouting }}
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}-${{ matrix.pgrouting }}

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Build docker image for ${{ env.POSTGRES_VERSION }}-${{ env.POSTGIS_VERSION }}-${{ env.PGROUTING_VERSION }}
run: |
docker build \
--build-arg POSTGRES_VERSION=${{ env.POSTGRES_VERSION }} \
--build-arg POSTGIS_VERSION=${{ env.POSTGIS_VERSION }} \
--build-arg PGROUTING_VERSION=${{ env.PGROUTING_VERSION }} \
-t pgrouting/pgrouting:${{ env.POSTGRES_VERSION }}-${{ env.POSTGIS_VERSION }}-${{ env.PGROUTING_VERSION }} .
- name: Build docker image for ${{ env.VERSION }}
run: make build

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Push docker image to Docker Hub
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
run: |
docker push pgrouting/pgrouting:${{ env.POSTGRES_VERSION }}-${{ env.POSTGIS_VERSION }}-${{ env.PGROUTING_VERSION }}
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
run: make push

0 comments on commit 96d5b92

Please sign in to comment.