updated workflow #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |