Skip to content

Publish Frontend Image to GHCR #2

Publish Frontend Image to GHCR

Publish Frontend Image to GHCR #2

name: Publish Frontend Image to GHCR
on:
workflow_dispatch:
inputs:
tag:
description: 'Image tag'
required: true
default: 'latest'
NEXT_PUBLIC_CHAT_API:
description: 'Chat API URL'
required: true
env:
IMAGE_NAME: varaamo-info-rag-demo-front
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.event.inputs.tag }}
type=sha,prefix={{date 'YYYYMMDD'}}-
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./frontend
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
NEXT_PUBLIC_CHAT_API=${{ github.event.inputs.NEXT_PUBLIC_CHAT_API }}