updated workflow #15
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@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: | | ||
make postgres | ||
docker tag cybertec-pg-container/postgres:$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX $CONTAINER_REPO:postgres-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
docker save -o postgres.tar $CONTAINER_REPO:postgres-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
- 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:$IMAGE_TAG_PREFIX-$POSTGIS_VERSION-$IMAGE_TAG_SUFFIX $CONTAINER_REPO:postgres-gis-$IMAGE_TAG_PREFIX-$POSTGIS_VERSION-$IMAGE_TAG_SUFFIX | ||
docker save -o postgres-gis.tar $CONTAINER_REPO:postgres-gis-$IMAGE_TAG_PREFIX-$POSTGIS_VERSION-$IMAGE_TAG_SUFFIX | ||
- name: Build pgBackRest | ||
id: build-pgbackrest | ||
run: | | ||
make pgbackrest | ||
docker tag cybertec-pg-container/pgbackrest:$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX $CONTAINER_REPO:pgbackrest-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
docker save -o pgbackrest.tar $CONTAINER_REPO:pgbackrest-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
- name: Build exporter | ||
id: build-exporter | ||
run: | | ||
make exporter | ||
docker tag cybertec-pg-container/exporter:$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX $CONTAINER_REPO:exporter-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
docker save -o exporter.tar $CONTAINER_REPO:exporter-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
- name: Build pgBouncer | ||
id: build-pgbouncer | ||
run: | | ||
make pgBouncer | ||
docker tag cybertec-pg-container/pgBouncer:$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX $CONTAINER_REPO:pgBouncer-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
docker save -o pgBouncer.tar $CONTAINER_REPO:pgBouncer-$IMAGE_TAG_PREFIX-$IMAGE_TAG_SUFFIX | ||
- 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 postgres-gis.tar | ||
- name: Load Postgres-gis image | ||
run: docker load -i postgres-gis.tar | ||
- name: Load Postgres-gis image | ||
run: docker load -i postgres-gis.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 }} | ||