Skip to content

ci: abstract generic CI into separate workflow #11

ci: abstract generic CI into separate workflow

ci: abstract generic CI into separate workflow #11

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:
uses: winstxnhdw/CapGen/.github/workflows/main.yml@main
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@v5
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"