name: backend on: push: branches: [main] paths: - "backend/**" - ".github/workflows/backend.yml" pull_request: paths: - "backend/**" jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install working-directory: backend run: pip install -e .[dev] - name: Smoke tests working-directory: backend run: pytest -q - name: Lint working-directory: backend run: ruff check src tests build-and-push: needs: test if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - uses: docker/setup-buildx-action@v3 - uses: docker/build-push-action@v6 with: context: ./backend push: true tags: | ghcr.io/${{ github.repository_owner }}/mist-backend:latest ghcr.io/${{ github.repository_owner }}/mist-backend:${{ github.sha }}