Skip to content

Commit 6e8557f

Browse files
committed
New matrix release process
1 parent 0f572ef commit 6e8557f

File tree

2 files changed

+62
-16
lines changed

2 files changed

+62
-16
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
postgres_version: [15, 16, 17]
912
steps:
1013
- name: Checkout
1114
uses: actions/checkout@v4
@@ -29,10 +32,51 @@ jobs:
2932
string: ${{ github.repository }}
3033

3134
- name: Build
32-
uses: docker/build-push-action@v5
35+
uses: docker/build-push-action@v6
3336
with:
3437
push: true
38+
build-args: |
39+
POSTGRES_VERSION=${{ matrix.postgres_version }}
3540
tags: |
3641
${{ 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}}
3843
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: true
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

Dockerfile

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
FROM alpine:3.19.1
1+
FROM alpine:3.22.1
22
LABEL maintainer="Fedor Borshev <fedor@borshev.com>"
33

4+
ARG POSTGRES_VERSION=17
5+
46
RUN apk update \
5-
&& apk --no-cache add dumb-init postgresql-client curl aws-cli supercronic
7+
&& apk --no-cache add dumb-init postgresql${POSTGRES_VERSION}-client curl aws-cli supercronic
68

79

8-
ENV POSTGRES_DATABASE **None**
9-
ENV POSTGRES_HOST **None**
10-
ENV POSTGRES_PORT 5432
11-
ENV POSTGRES_USER **None**
12-
ENV POSTGRES_PASSWORD **None**
10+
ENV POSTGRES_DATABASE=**None**
11+
ENV POSTGRES_HOST=**None**
12+
ENV POSTGRES_PORT=5432
13+
ENV POSTGRES_USER=**None**
14+
ENV POSTGRES_PASSWORD=**None**
1315
ENV POSTGRES_EXTRA_OPTS ''
14-
ENV S3_ACCESS_KEY_ID **None**
15-
ENV S3_SECRET_ACCESS_KEY **None**
16-
ENV S3_BUCKET **None**
16+
ENV S3_ACCESS_KEY_ID=**None**
17+
ENV S3_SECRET_ACCESS_KEY=**None**
18+
ENV S3_BUCKET=**None**
1719
ENV S3_REGION us-west-1
1820
ENV S3_PATH 'backup'
19-
ENV S3_ENDPOINT **None**
20-
ENV S3_S3V4 no
21-
ENV SCHEDULE **None**
22-
ENV SUCCESS_WEBHOOK **None**
21+
ENV S3_ENDPOINT=**None**
22+
ENV S3_S3V4=no
23+
ENV SCHEDULE=**None**
24+
ENV SUCCESS_WEBHOOK=**None**
2325

2426
ADD entrypoint.sh .
2527
ADD backup.sh .

0 commit comments

Comments
 (0)