Skip to content

SBCOSS-399: created workflow to publish image to ghcr #2

SBCOSS-399: created workflow to publish image to ghcr

SBCOSS-399: created workflow to publish image to ghcr #2

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
tags:
- 'release*'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker image name
id: vars
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository }}" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build -t $IMAGE_NAME:${{ github.ref_name }} .
- name: Push Docker image
run: |
docker push $IMAGE_NAME:${{ github.ref_name }}