name: Build and Push Image
on: [push]

jobs:
  build-and-push:
    runs-on: ubuntu-latest
    # Required for building containers inside a containerized runner
    container:
      image: catthehacker/ubuntu:act-latest
    
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Log in to Gitea Registry
        uses: docker/login-action@v2
        with:
          registry: gitea.nelson-household.com  # Replace with your Gitea domain
          username: ${{ gitea.actor }}
          password: ${{ secrets.RUNNER_TOKEN }}

      - name: Build and Push Image
        run: |
          docker build -t gitea.nelson-household.com/joseph.nelson4456/koillection-uploader/koillection-uploader:${{ github.sha }} .
          docker push gitea.nelson-household.com/joseph.nelson4456/koillection-uploader/koillection-uploader:${{ github.sha }}
