forked from cmwedding-it/docker-postgres-autoconf
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (85 loc) · 2.89 KB
/
ci.yaml
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
name: ci
permissions:
packages: write
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
schedule:
# See https://crontab.guru/monthly
- cron: 0 0 1 * *
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg_version:
- "16"
- "15"
# - "13"
platform:
- "amd64"
- "arm64"
env:
PG_LATEST: "16"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: matrix.platform != 'amd64'
with:
platforms: ${{ matrix.platform }}
- name: Get build date
id: date
run: echo "date=$(date --rfc-3339 ns)" >> $GITHUB_OUTPUT
- name: Get latest tag
id: tag-latest
if: matrix.pg_version == env.PG_LATEST
run: echo "tag=${{ matrix.platform == 'amd64' && ' latest' || format(' latest-{0}', matrix.platform) }}" >> $GITHUB_OUTPUT
- name: Build image Postgres
id: buildpg
uses: redhat-actions/buildah-build@v2
with:
image: postgres-autoconf
tags: ${{ matrix.platform == 'amd64' && format('{0}-alpine', matrix.pg_version) || format('{0}-alpine-{1}', matrix.pg_version, matrix.platform) }}${{ steps.tag-latest.outputs.tag || '' }}
context: .
platforms: linux/${{ matrix.platform }}
containerfiles: |
Dockerfile
build-args: |
BUILD_DATE=${{ steps.date.outputs.date }}
VCS_REF=${{ github.sha }}
BASE_TAG=${{ matrix.pg_version }}-alpine
- name: Push image Postgres to GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.buildpg.outputs.image }}
tags: ${{ steps.buildpg.outputs.tags }}
registry: ghcr.io/openspp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image PostGIS
id: buildpgis
uses: redhat-actions/buildah-build@v2
with:
image: postgis-autoconf
tags: ${{ matrix.platform == 'amd64' && format('{0}-alpine', matrix.pg_version) || format('{0}-alpine-{1}', matrix.pg_version, matrix.platform) }}${{ steps.tag-latest.output.tag || '' }}
context: .
platforms: linux/${{ matrix.platform }}
containerfiles: |
Dockerfile-GIS
build-args: |
BUILD_DATE=${{ steps.date.output.date }}
VCS_REF=${{ github.sha }}
BASE_TAG=${{ matrix.pg_version }}-alpine
- name: Push image PostGIS to GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.buildpgis.outputs.image }}
tags: ${{ steps.buildpgis.outputs.tags }}
registry: ghcr.io/openspp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}