Optimize docker buildx cache

pull/289/head
Rizky Maulana Nugraha 2021-01-28 01:26:41 +07:00
rodzic 8c9f610e4e
commit bd42b7632f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F08C600969AC1656
1 zmienionych plików z 25 dodań i 2 usunięć

Wyświetl plik

@ -59,6 +59,7 @@ jobs:
context: .
file: Dockerfile
push: false
load: true
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
build-args: |
DISTRO=${{ matrix.distro }}
@ -69,7 +70,7 @@ jobs:
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
target: postgis-base
- name: Build prod image
@ -90,9 +91,30 @@ jobs:
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
target: postgis-prod
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: false
load: true
tags: kartoza/postgis:manual-build
build-args: |
DISTRO=${{ matrix.distro }}
IMAGE_VERSION=${{ matrix.imageVersion }}
IMAGE_VARIANT=${{ matrix.imageVariant }}
GENERATE_ALL_LOCALE=0
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
target: postgis-test
run-scenario-tests:
runs-on: ubuntu-latest
needs: [ build-image ]
@ -145,6 +167,7 @@ jobs:
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
cache-from: type=local,src=/tmp/.buildx-cache
target: postgis-test
- name: Run scenario test