Skip to content

Build and Publish Docker Image #2

Build and Publish Docker Image

Build and Publish Docker Image #2

Workflow file for this run

name: Build and Publich Docker Image
on:
workflow_dispatch:
inputs:
version:
description: The image version
required: true
type: string
env:
IMAGE_NAME: befit
jobs:
build-and-publish:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag $IMAGE_NAME:${{ inputs.version }}
working-directory: backend
- name: Login to Container registry
run: docker login ghcr.io -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
- name: Publish the Docker image
run: docker push $IMAGE_NAME:${{ inputs.version }}