Skip to content

Feat/sec 147/docker build push #1

Feat/sec 147/docker build push

Feat/sec 147/docker build push #1

Workflow file for this run

name: Build and Push Docker Image on Merged Pull Request
on:
pull_request:
types: [closed]
jobs:
build:
if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'dev-') && startsWith(github.event.pull_request.base.ref, 'pg-v') }}
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 target branch name
id: extract_branch
run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: mesoform/postgres-ha:${{ env.TARGET_BRANCH }}