forked from postgis/docker-postgis
-
Notifications
You must be signed in to change notification settings - Fork 6
111 lines (93 loc) · 3.55 KB
/
multiarch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Docker PostGIS CI
on:
push:
paths-ignore:
- '.github/dependabot.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
pull_request:
schedule:
- cron: '15 5 * * 2' # Weekly, 1 day after the upstream
# Cancel existing executions when new commits are pushed onto the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
make-docker-images:
strategy:
fail-fast: false
matrix:
# exclude the latest version set for use with "include" below
postgres: [13, 14, 15, 16]
postgis: ['3.5']
latest: [false]
include:
- postgres: 17 # only use the single latest version with "latest: true"
postgis: '3.5'
latest: true
name: Build docker image for ${{ matrix.postgres }}-${{ matrix.postgis }}
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
packages: write
env:
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}
steps:
- name: Set up QEMU for amd64 and arm64
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- name: Set up Depot CLI
uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5
- name: Docker meta
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
with:
images: ghcr.io/${{ github.repository_owner }}/postgis
labels: |
org.opencontainers.image.title=postgis
org.opencontainers.image.version=${{ env.VERSION }}
org.opencontainers.image.base.name=docker.io/postgis/postgis:${{ env.VERSION }}
tags: |
type=raw,value=${{ env.VERSION }},enable=true,priority=200
type=raw,value=${{ matrix.postgres }},enable=true,priority=200
type=raw,value=latest,enable=${{ matrix.latest }},priority=200
- name: Login to GitHub Container Registry
if: ${{ (github.ref == 'refs/heads/multiarch') && (github.event_name != 'pull_request') && !env.ACT }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Multi-platform build without push
if: ${{ !((github.ref == 'refs/heads/multiarch') && (github.event_name != 'pull_request') && !env.ACT) }}
uses: depot/build-push-action@636daae76684e38c301daa0c5eca1c095b24e780
with:
project: p4q8k8mb22
platforms: linux/amd64,linux/arm64
context: https://github.com/postgis/docker-postgis.git#master
file: ${{ env.VERSION }}/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pull: true
push: false
- name: Multi-platform build and push
if: ${{ (github.ref == 'refs/heads/multiarch') && (github.event_name != 'pull_request') && !env.ACT }}
uses: depot/build-push-action@636daae76684e38c301daa0c5eca1c095b24e780
with:
project: p4q8k8mb22
no-cache: true
platforms: linux/amd64,linux/arm64
context: https://github.com/postgis/docker-postgis.git#master
file: ${{ env.VERSION }}/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pull: true
push: true