6
6
jobs :
7
7
build :
8
8
runs-on : ubuntu-latest
9
+ strategy :
10
+ matrix :
11
+ postgres_version : [15, 16, 17]
9
12
steps :
10
13
- name : Checkout
11
14
uses : actions/checkout@v4
@@ -29,10 +32,51 @@ jobs:
29
32
string : ${{ github.repository }}
30
33
31
34
- name : Build
32
- uses : docker/build-push-action@v5
35
+ uses : docker/build-push-action@v6
33
36
with :
34
- push : true
37
+ push : false
38
+ build-args : |
39
+ POSTGRES_VERSION=${{ matrix.postgres_version }}
35
40
tags : |
36
41
${{ steps.name.outputs.lowercase }}:latest
37
- ${{ steps.name.outputs.lowercase }}:${{ github.event.release.name }}
42
+ ${{ steps.name.outputs.lowercase }}:${{ github.event.release.name }}-pg${{matrix.postgres_version}}
38
43
platforms : linux/amd64,linux/arm64
44
+ cache-from : type=gha
45
+ cache-to : type=gha,mode=max
46
+
47
+ build-latest :
48
+ runs-on : ubuntu-latest
49
+ needs : build
50
+ steps :
51
+ - name : Checkout
52
+ uses : actions/checkout@v4
53
+
54
+ - name : Set up QEMU
55
+ uses : docker/setup-qemu-action@v3
56
+
57
+ - name : Set up Docker Buildx
58
+ uses : docker/setup-buildx-action@v3
59
+
60
+ - name : Login to Docker Hub
61
+ uses : docker/login-action@v3
62
+ with :
63
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
64
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
65
+
66
+ - name : Generate image identifier
67
+ id : name
68
+ uses : ASzc/change-string-case-action@v5
69
+ with :
70
+ string : ${{ github.repository }}
71
+
72
+ - name : Build
73
+ uses : docker/build-push-action@v6
74
+ with :
75
+ push : false
76
+ build-args : |
77
+ POSTGRES_VERSION=17
78
+ tags : |
79
+ ${{ steps.name.outputs.lowercase }}:latest
80
+ platforms : linux/amd64,linux/arm64
81
+ cache-from : type=gha
82
+ cache-to : type=gha,mode=max
0 commit comments