File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Images
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch : {}
8+
9+ permissions :
10+ contents : read
11+ packages : write
12+
13+ env :
14+ IMAGE_NAME : ghcr.io/${{ github.repository }}
15+
16+ concurrency :
17+ group : ${{ github.workflow }}-${{ github.ref }}
18+ cancel-in-progress : true
19+
20+ jobs :
21+ build-and-push :
22+ runs-on : ubuntu-latest
23+ strategy :
24+ fail-fast : false
25+ matrix :
26+ base_version :
27+ - 16-alpine
28+ - 16-alpine3.21
29+ - 16-alpine3.22
30+ - 16-trixie
31+ - 15-alpine
32+ - 15-alpine3.21
33+ - 15-alpine3.22
34+ - 15-trixie
35+ - 14-alpine
36+ - 14-alpine3.21
37+ - 14-alpine3.22
38+ - 14-trixie
39+ - 13-alpine
40+ - 13-alpine3.21
41+ - 13-alpine3.22
42+ - 13-trixie
43+
44+ steps :
45+ - name : Checkout
46+ uses : actions/checkout@v4
47+
48+ - name : Set up Docker Buildx
49+ uses : docker/setup-buildx-action@v3
50+
51+ - name : Log in to GitHub Container Registry
52+ uses : docker/login-action@v3
53+ with :
54+ registry : ghcr.io
55+ username : ${{ github.actor }}
56+ password : ${{ secrets.GITHUB_TOKEN }}
57+
58+ - name : Build and push (${{ matrix.base_version }})
59+ run : |
60+ docker buildx build \
61+ --build-arg BASE_VERSION=${{ matrix.base_version }} \
62+ --tag $IMAGE_NAME:${{ matrix.base_version }} \
63+ --push \
64+ .
65+
66+
Original file line number Diff line number Diff line change 1+ ARG BASE_VERSION
2+ FROM postgres:${BASE_VERSION}
3+
4+ RUN apk add --no-cache build-base git clang llvm lld
5+
6+ RUN git clone --depth=1 https://github.com/citusdata/pg_cron /tmp/pg_cron && \
7+ make -C /tmp/pg_cron \
8+ CLANG="$(command -v clang)" \
9+ LLVM_CONFIG="$(command -v llvm-config)" \
10+ LLVM_AR="$(command -v llvm-ar)" \
11+ LLVM_RANLIB="$(command -v llvm-ranlib)" \
12+ LLVM_LTO="$(command -v llvm-lto)" && \
13+ make -C /tmp/pg_cron install && \
14+ rm -rf /tmp/pg_cron
15+
16+ RUN echo "shared_preload_libraries = 'pg_cron'" >> /usr/local/share/postgresql/postgresql.conf.sample
You can’t perform that action at this time.
0 commit comments