Skip to content

build(deps-dev): bump the dependencies group with 2 updates (#4) #4

build(deps-dev): bump the dependencies group with 2 updates (#4)

build(deps-dev): bump the dependencies group with 2 updates (#4) #4

Workflow file for this run

name: Build
on:
push:
branches: [main]
paths:
- .github/workflows/build.yml
- Dockerfile.build
- pyproject.toml
- poetry.lock
- .dockerignore
- server/**
- tests/**
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry
- name: Install dependencies
run: poetry install
- name: Run linter
run: poetry run pylint $(git ls-files '*.py')
- name: Run type checker
run: poetry run pyright
- name: Test
run: poetry run pytest
build:
runs-on: ubuntu-latest
permissions:
packages: write
env:
REGISTRY: ghcr.io
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
uses: docker/[email protected]
id: meta
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
file: Dockerfile.build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
restart:
needs: [test, build]
runs-on: ubuntu-latest
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
steps:
- name: Factory restart API
run: |
curl -X POST https://huggingface.co/api/spaces/$GITHUB_REPOSITORY/restart?factory=true \
-H "Authorization: Bearer $HF_TOKEN"