Skip to content

add localbuild env for local deployment and changed build args #6

add localbuild env for local deployment and changed build args

add localbuild env for local deployment and changed build args #6

name: Build_and_Push_Docker_Image
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build-and-push:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate date tag using Ubuntu 'date' command
id: date
run: echo "tag=$(date +'%Y.%m.%d-%H.%M')" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: deployment/docker/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.date.outputs.tag }}