Skip to content

Add GitHub Actions workflow for Docker image CI #3

Add GitHub Actions workflow for Docker image CI

Add GitHub Actions workflow for Docker image CI #3

Workflow file for this run

name: Docker pgRouting CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '15 5 * * 1'
defaults:
run:
shell: bash
jobs:
make-docker-images:
strategy:
matrix:
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') || (matrix.pgrouting == 'main') }}
env:
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}-${{ matrix.pgrouting }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Build docker image for ${{ env.VERSION }}
run: make build
- name: Test docker image for ${{ env.VERSION }}
run: make test
- name: Login to Docker Hub
uses: docker/login-action@v3
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/master') && (github.event_name != 'pull_request') }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
run: make push