name: Test build

on:
  push:
    branches: [ main ]

jobs:
  build:
    runs-on: [dev, amd64]
    steps:
      - uses: actions/checkout@v4
      - name: docker login
        run: |
          docker login gitea.ceperka.net -u "${{ secrets.REPO_USERNAME }}" -p "${{ secrets.REPO_PASSWORD }}"
      - name: Build
        run: task build REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
      - name: Test
        run: task test REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
      - name: Push
        run: task push REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
      - name: Cleaning step
        if: always()
        run: docker stop dev_test || exit 0


