name: Build shape-ai

on:
  push:
    branches: master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:

      - name: Checkout Repo
        uses: actions/checkout@v4

      - name: Login to Registry
        run: docker login gitea.craisin.tech --username ${{ secrets.REGISTRY_USER }} --password ${{ secrets.REGISTRY_PASSWORD }}

      - name: Build Docker Image
        run: docker build -t gitea.craisin.tech/craisin/shape_ai:latest .

      - name: Push Docker Images
        run: docker push gitea.craisin.tech/craisin/shape_ai:latest

      - name: Log out from registry
        if: always()
        run: docker logout gitea.craisin.tech