name: Build Feeme Next.js Frontend App

defaults:
  run:
    working-directory: ./feedme

on:
  push:
    branches:
      - main

jobs:
  build-and-push:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log in to Gitea Container Registry
        uses: docker/login-action@v3
        with:
          registry: ${{vars.REGISTRY_URL}}
          username: ${{github.actor}}
          password: ${{secrets.TOKEN}}

      - name: Build Docker image
        run: |
          docker build -f Dockerfile-prod -t ${{vars.REGISTRY_URL}}/${{github.repository}}-frontend-test:latest .

      - name: Push Docker image
        run: |
          docker push ${{vars.REGISTRY_URL}}/${{github.repository}}-frontend-test:latest
