v1.5.10 — Step 7 label fix #28
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: Release — Deploy & Docker | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Prepare deploy directory | |
| run: | | |
| mkdir -p deploy | |
| cp hf-space/Dockerfile deploy/ | |
| cp hf-space/main_hf.py deploy/ | |
| cp hf-space/README.md deploy/ | |
| cp backend/requirements.txt deploy/ | |
| cp -r backend/app deploy/ | |
| cp -r backend/datasets deploy/ | |
| cp -r backend/data_cache deploy/ | |
| cp -r local/model-arena/arena deploy/ | |
| cp -r frontend/dist deploy/static | |
| echo "*.pyc" > deploy/.gitignore | |
| echo "__pycache__/" >> deploy/.gitignore | |
| - name: Build Docker image | |
| run: docker build -t healthwithsevgi:ci deploy | |
| - name: Smoke-test container | |
| run: | | |
| docker run -d --name hws-test -p 7860:7860 healthwithsevgi:ci | |
| for i in 1 2 3 4 5 6; do | |
| sleep 5 | |
| HEALTH=$(curl -sf http://localhost:7860/health 2>&1) && break | |
| echo "Attempt $i: not ready yet..." | |
| done | |
| echo "Health response: ${HEALTH:-unreachable}" | |
| docker logs hws-test | |
| docker rm -f hws-test | |
| echo "${HEALTH}" | grep -q '"status":"healthy"' || { echo "::error::Health check failed"; exit 1; } | |
| - name: Push to HuggingFace Space | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| cd deploy | |
| git init -b main | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "Deploy ${{ github.event.release.tag_name }}" | |
| git push --force https://0xBatuhan4:${HF_TOKEN}@huggingface.co/spaces/0xBatuhan4/HealthWithSevgi main | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push Docker image to GHCR | |
| run: | | |
| docker tag healthwithsevgi:ci ghcr.io/eudalabs/healthwithsevgi:${{ github.event.release.tag_name }} | |
| docker tag healthwithsevgi:ci ghcr.io/eudalabs/healthwithsevgi:latest | |
| docker push ghcr.io/eudalabs/healthwithsevgi:${{ github.event.release.tag_name }} | |
| docker push ghcr.io/eudalabs/healthwithsevgi:latest |