Skip to content

Merge pull request #100 from mesoform/dev-pg-v14 #1

Merge pull request #100 from mesoform/dev-pg-v14

Merge pull request #100 from mesoform/dev-pg-v14 #1

Workflow file for this run

name: Build and Push Release Docker Images
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version parts
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
MAJOR_MINOR=$(echo $VERSION | awk -F '-' '{print $1}')
MAJOR=$(echo $MAJOR_MINOR | awk -F '.' '{print $1}')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR_MINOR=$MAJOR_MINOR" >> $GITHUB_ENV
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
mesoform/postgres-ha:release-${{ env.VERSION }}
mesoform/postgres-ha:release-${{ env.MAJOR_MINOR }}
mesoform/postgres-ha:${{ env.MAJOR }}-latest