-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 2.79 KB
/
docker-publish.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
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
- cron: '00 8 * * *'
push:
branches: [ "main" ]
tags: [ '*.*.*' ]
pull_request:
branches: [ "main" ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: neuroforgede/pgaf-swarm
jobs:
build:
strategy:
fail-fast: false
matrix:
version:
- postgres: "14"
postgres_major: "14"
citus: "11.2.1"
pg_cron: "1.4.2"
- postgres: "14.7"
postgres_major: "14"
citus: "11.2.1"
pg_cron: "1.4.2"
- postgres: "15"
postgres_major: "15"
citus: "11.2.1"
pg_cron: "1.4.2"
- postgres: "15.2"
postgres_major: "15"
citus: "11.2.1"
pg_cron: "1.4.2"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@165fe681b849eec43aaa64d786b9ec53e690475f
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=-pg-${{ matrix.version.postgres }}-citus-${{ matrix.version.citus }}-pgcron-${{ matrix.version.pg_cron }}
latest=false
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@37abcedcc1da61a57767b7588cb9d03eb57e28b3
with:
context: pgaf/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
POSTGRES_VERSION=${{ matrix.version.postgres }}
POSTGRES_MAJOR_VERSION=${{ matrix.version.postgres_major }}
CITUSTAG=v${{ matrix.version.citus }}
PG_CRON_TAG=v${{ matrix.version.pg_cron }}
cache-from: type=gha
cache-to: type=gha,mode=max