-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (76 loc) · 3.47 KB
/
build_containers.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
name: Build and publish the Containers
on:
push:
branches:
- build_workflow
jobs:
build:
runs-on: ubuntu-latest
env:
ROOTPATH: /home/runner/work/CYBERTEC-pg-container/CYBERTEC-pg-container
BASEOS: rocky9
BUILD: 1
PGVERSION_FULL: 16.3
POSTGIS_VERSION: 34
IMAGE_TAG_PREFIX: $BASEOS-$PGVERSION_FULL
IMAGE_TAG_SUFFIX: $BUILD
CONTAINER_REPO: docker.io/cybertecpostgresql/cybertec-pg-container-dev
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build Postgres $IMAGE_TAG_PREFIX-IMAGE_TAG_SUFFIX
id: build-postgres
run: |
make postgres
docker tag cybertec-pg-container/postgres:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/postgres-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
# docker save -o postgres.tar $CONTAINER_REPO/postgres-$BASEOS-$PGVERSION_FULL-$BUILD
- name: Build Postgres with GIS $IMAGE_TAG_PREFIX-$POSTGIS_VERSION-$IMAGE_TAG_SUFFIX
id: build-postgres-gis
run: |
make postgres-gis
docker tag cybertec-pg-container/postgres-gis:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/postgres-gis-$BASEOS-$PGVERSION_FULL-$POSTGIS_VERSION-$GITHUB_SHA
# docker save -o postgres-gis.tar $CONTAINER_REPO/postgres-gis-$BASEOS-$PGVERSION_FULL-$POSTGIS_VERSION-$BUILD
- name: Build pgBackRest
id: build-pgbackrest
run: |
make pgbackrest
docker tag cybertec-pg-container/pgbackrest:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/pgbackrest-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
# docker save -o pgbackrest.tar $CONTAINER_REPO/pgbackrest-$BASEOS-$PGVERSION_FULL-$BUILD
- name: Build exporter
id: build-exporter
run: |
make exporter
docker tag cybertec-pg-container/exporter:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/exporter-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
# docker save -o exporter.tar $CONTAINER_REPO/exporter-$BASEOS-$PGVERSION_FULL-$BUILD
- name: Build pgBouncer
id: build-pgbouncer
run: |
make pgbouncer
docker images
docker tag cybertec-pg-container/pgbouncer:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/pgbouncer-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
- name: Log in to Docker Hub
run: echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: push Containers
run: |
docker push $CONTAINER_REPO/postgres-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
docker push $CONTAINER_REPO/postgres-gis-$BASEOS-$PGVERSION_FULL-$POSTGIS_VERSION-$GITHUB_SHA
docker push $CONTAINER_REPO/pgbackrest-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
docker push $CONTAINER_REPO/exporter-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
docker push $CONTAINER_REPO/pgbouncer-$BASEOS-$PGVERSION_FULL-$GITHUB_SHA
# docker save -o pgbouncer.tar $CONTAINER_REPO/pgbouncer-$BASEOS-$PGVERSION_FULL-$BUILD
# - name: Upload Containers
# uses: actions/upload-artifact@v2
# with:
# name: docker-images
# path: |
# postgres.tar
# postgres-gis.tar
# pgbackrest.tar
# exporter.tar
# pgbouncer.tar