Skip to content

feat: use original path for swagger #74

feat: use original path for swagger

feat: use original path for swagger #74

Workflow file for this run

name: Build
on:
push:
branches: [main]
paths:
- .github/workflows/build.yml
- Dockerfile.build
- poetry.lock
- pyproject.toml
- server/**
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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
- name: Log in to the Container registry
uses: docker/login-action@v2.2.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
uses: docker/metadata-action@v4.6.0
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 }}
- name: Factory restart API
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
curl -X POST https://huggingface.co/api/spaces/$GITHUB_REPOSITORY/restart?factory=true \
-H "Authorization: Bearer $HF_TOKEN"