Merge pull request #104 from mesoform/pg-v14 #2
Workflow file for this run
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 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 |