Skip to content

[release] 2.0.50

[release] 2.0.50 #48

name: Docker Image Build & Push
on:
push:
branches: ["master", "sojinss4u/dockerimagebuild"]
tags: ['*.*.*']
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
# The 'services' block has been removed. The Dockerfile is now fully self-sufficient
# and does not need any external services during the build.
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.PUBLIC_DOCKER_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKER_PASSWORD }}
- name: Get Build Info
id: build_info
run: |
TRIGGER_SHA=${{ github.event.pull_request.head.sha || github.sha }}
echo "trigger_sha=${TRIGGER_SHA}" >> $GITHUB_OUTPUT
# Generate build timestamp in UTC
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "build_date=${BUILD_DATE}" >> $GITHUB_OUTPUT
- name: Determine Docker Tag
id: vars
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
IMAGE_TAG="${GITHUB_REF#refs/tags/}"
echo "tags=razorpay/ifsc:${IMAGE_TAG},razorpay/ifsc:latest" >> $GITHUB_OUTPUT
else
# Use the trigger SHA instead of the merge commit SHA
IMAGE_TAG="${{ steps.build_info.outputs.trigger_sha }}"
echo "tags=razorpay/ifsc:${IMAGE_TAG}" >> $GITHUB_OUTPUT
fi
- name: Build & Push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.vars.outputs.tags }}
# No special network configuration or REDIS_HOST arguments are needed.
build-args: |
VERSION=${{ github.ref_name }}
COMMIT=${{ steps.build_info.outputs.trigger_sha }}
BUILD_DATE=${{ steps.build_info.outputs.build_date }}