Skip to content

Build Stackpack Nextjs Shadcn App Image #8

Build Stackpack Nextjs Shadcn App Image

Build Stackpack Nextjs Shadcn App Image #8

name: Build Stackpack Nextjs Shadcn App Image
on:
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag'
required: false
default: 'latest'
type: string
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-pack-nextjs-shadcn
DOCKERFILE_PATH: images/NextjsShadcnDockerFile
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ inputs.tag }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: frontend
file: ${{ env.DOCKERFILE_PATH }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}