From 96d5b9206e4aa0f7e02e53130f70878114ea72c8 Mon Sep 17 00:00:00 2001 From: Ko Nagase Date: Mon, 3 Feb 2025 23:58:19 +0900 Subject: [PATCH] Updating CI with following docker-postgis Makefile Comment out matrix to match existing folders for test --- .github/workflows/main.yml | 44 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e074e71..35824cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,13 +2,7 @@ name: Docker pgRouting CI on: push: - branches: - - main - - develop pull_request: - branches: - - main - - develop schedule: - cron: '15 5 * * 1' @@ -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 }} \ No newline at end of file + 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