name: Backend Deploy
on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Login
        with:
          package_rw: ${{ secrets.PACKAGE_RW }}
        run: docker login gitea.seeseepuff.be -u seeseemelk -p ${{ secrets.PACKAGE_RW }}

      - name: Build
        run: |
          cd backend
          docker build -t gitea.seeseepuff.be/seeseemelk/allowance-planner:latest .

      - name: Push
        run: |
          cd backend
          docker push gitea.seeseepuff.be/seeseemelk/allowance-planner:latest

      - name: Trigger watchtower
        uses: https://gitea.seeseepuff.be/actions/watchtower@master
