-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (98 loc) · 3.97 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build Postgres $IMAGE_TAG_PREFIX-IMAGE_TAG_SUFFIX
id: build-postgres
run: |
echo "cybertec-pg-container/postgres:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/postgres-$BASEOS-$PGVERSION_FULL-$BUILD"
make postgres
docker tag cybertec-pg-container/postgres:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/postgres-$BASEOS-$PGVERSION_FULL-$BUILD
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-$BUILD
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-$BUILD
docker save -o pgbackrest.tar $CONTAINER_REPO/pgbackrest-$BASEOS-$PGVERSION_FULL-$BUILD
- name: Build exporter
id: build-exporter
run: |
make exporter
docker images
docker tag cybertec-pg-container/exporter:$BASEOS-$PGVERSION_FULL-$BUILD $CONTAINER_REPO/exporter-$BASEOS-$PGVERSION_FULL-$BUILD
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-$BUILD
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
push:
runs-on: ubuntu-latest
env:
IMAGEPRAEFIX: docker.io/cybertecpostgresql/cybertec-pg-container-dev
BASEOS: rocky9
BUILD: 1
PGVERSION: 16.3
TYPE: dev
needs: build
steps:
- name: Download Containers
uses: actions/download-artifact@v2
with:
name: docker-images
- name: Load Postgres image
run: docker load -i postgres.tar
- name: Load Postgres-gis image
run: docker load -i postgres-gis.tar
- name: Load Postgres-gis image
run: docker load -i pgbackrest.tar
- name: Load Postgres-gis image
run: docker load -i exporter.tar
- name: Load Postgres-gis image
run: docker load -i pgbouncer.tar
- name: Log in to Docker Hub
run: echo ${{ secrets.DOCKER_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# - name: push postgres
# run: |
# docker push user/container1:release-${{ github.event.release.tag_name }}