-
Notifications
You must be signed in to change notification settings - Fork 6
107 lines (92 loc) · 3.49 KB
/
packages.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
98
99
100
101
102
103
104
105
106
107
name: Build Image and Push
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
release:
types: [ published ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN
permissions:
packages: write
contents: read
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/cdpgvecto.rs
jobs:
postgres:
strategy:
fail-fast: false
matrix:
versions:
# renovate: datasource=docker depName=registry.developers.crunchydata.com/crunchydata/crunchy-postgres
- "ubi8-14.10-0"
# renovate: datasource=docker depName=registry.developers.crunchydata.com/crunchydata/crunchy-postgres
- "ubi8-15.5-0"
# renovate: datasource=docker depName=registry.developers.crunchydata.com/crunchydata/crunchy-postgres
- "ubi8-16.1-0"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine version change
id: changed-version
uses: tj-actions/changed-files@v40
with:
files: Dockerfile
- name: Determine image push
uses: actions/github-script@v7
id: should-release
with:
script: |
if (context.eventName == "pull_request") return false;
return "${{ steps.changed-version.outputs.any_changed }}" == "true";
- name: Set Postgres Version
id: version
run: |
CRUNCHY_VERSION=${{ matrix.versions }}
PG_VERSION=${CRUNCHY_VERSION#ubi8-}
PG_MAJOR=${PG_VERSION%.*}
echo "PG_MAJOR=$PG_MAJOR" >> "$GITHUB_OUTPUT"
- name: Extract PGVECTORS_TAG from Dockerfile
run: |
TAG=$(grep -oP 'ARG PGVECTORS_TAG=\K.*' Dockerfile)
echo "PGVECTORS_TAG=$TAG" >> $GITHUB_ENV
- name: Generate docker image tags
id: metadata
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=raw,value=${{ matrix.versions }}-${{ env.PGVECTORS_TAG }},enable=${{ steps.should-release.outputs.result }}
type=raw,value=${{ steps.version.outputs.PG_MAJOR }}-${{ env.PGVECTORS_TAG }},enable=${{ steps.should-release.outputs.result }}
type=raw,value=${{ matrix.versions }},enable=${{ steps.should-release.outputs.result }}
type=raw,value=${{ steps.version.outputs.PG_MAJOR }},enable=${{ steps.should-release.outputs.result }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
push: ${{ !github.event.pull_request.head.repo.fork && steps.metadata.outputs.tags != '' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
build-args: |
PG_MAJOR=${{ steps.version.outputs.PG_MAJOR }}
CRUNCHYDATA_VERSION=${{ matrix.versions }}