Skip to content

Build and Publish Docker Image #14

Build and Publish Docker Image

Build and Publish Docker Image #14

Workflow file for this run

name: Build and Publish Docker Image
on:
workflow_dispatch:
inputs:
version:
description: The image version
required: true
type: string
env:
IMAGE_NAME: befit
REGISTRY_URL: ghcr.io
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: install buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login $REGISTRY_URL -u ${{ github.actor }} --password-stdin
- name: Build and push the Docker image
run: docker buildx build --push --platform linux/arm64/v8,linux/amd64 --file Dockerfile --tag $REGISTRY_URL/${{ github.actor }}/$IMAGE_NAME:${{ inputs.version }} .
working-directory: backend