diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b611fc4..7a0350c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,21 +5,61 @@ on: branches: - 'master' +env: + VERSION: '15-3.4' + DOCKER_IMAGE: 'ghcr.io/jobrad-gmbh/postgis:15-3.4-alpine' + jobs: build-docker: - runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - runner: ubuntu-20.04 + platform: linux/amd64 + suffix: amd64 + - runner: Linux-ARM64-2C-8GB + platform: linux/arm64 + suffix: arm64 + runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images uses: docker/build-push-action@v5 with: context: . - file: 13-3.4/alpine/Dockerfile - platforms: linux/amd64,linux/arm64 + file: ${{ env.VERSION }}/alpine/Dockerfile + platforms: ${{ matrix.platform }} push: true tags: | - ghcr.io/jobrad-gmbh/postgis:13-3.4-alpine + ${{ env.DOCKER_IMAGE }}-${{ matrix.suffix }} + provenance: false + + combine-docker: + runs-on: ubuntu-latest + needs: build-docker + steps: + - name: Login to registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: int128/docker-manifest-create-action@v2 + with: + tags: ${{ env.DOCKER_IMAGE }} + sources: | + ${{ env.DOCKER_IMAGE }}-amd64 + ${{ env.DOCKER_IMAGE }}-arm64 + push: true