build(deps): bump uvicorn from 0.51.0 to 0.52.0 #263
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Backend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - '**' | |
| paths: | |
| - 'backend/**' | |
| - 'requirements.txt' | |
| - '.github/workflows/build-backend.yml' | |
| - 'Dockerfile' | |
| - 'tests/backend/**' | |
| workflow_dispatch: | |
| env: | |
| IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/wattbot | |
| jobs: | |
| build-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| with: | |
| lfs: 'true' | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| cache: 'pip' | |
| - name: Install backend dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run backend tests | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| pytest tests/backend | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v4 | |
| if: github.actor != 'dependabot[bot]' | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| if: github.actor != 'dependabot[bot]' | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Set Docker tag | |
| if: github.actor != 'dependabot[bot]' | |
| id: docker_tag | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/heads/main ]]; then | |
| echo "tag=edge" >> $GITHUB_OUTPUT | |
| elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| version=${GITHUB_REF#refs/tags/} | |
| echo "tag=${version},latest" >> $GITHUB_OUTPUT | |
| else | |
| branch=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-') | |
| echo "tag=branch-${branch}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build and push backend Docker image | |
| uses: docker/build-push-action@v7.3.0 | |
| if: github.actor != 'dependabot[bot]' | |
| with: | |
| context: . | |
| platforms: linux/arm64,linux/amd64 | |
| push: true | |
| tags: ${{ env.IMAGE }}:${{ steps.docker_tag.outputs.tag }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |