Skip to content

fixed jaf small issues (#458) #171

fixed jaf small issues (#458)

fixed jaf small issues (#458) #171

name: Build & Publish to GHCR
on:
push:
branches:
- main
- develop
permissions:
contents: read
packages: write
id-token: write
env:
REGISTRY: ghcr.io
IMAGE: ${{ github.repository_owner }}/tpc-frontend
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Copy environment file
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
cp .env.production .env.production.local
elif [ "${{ github.ref_name }}" = "develop" ]; then
cp .env.development .env.production.local
else
echo "Unknown branch: ${{ github.ref_name }}"
exit 1
fi
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
tags: |
type=ref,event=branch
- name: Build & push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}