Skip to content

Merge pull request #29 from Imaging-Plaza/update-hf-deploy #5

Merge pull request #29 from Imaging-Plaza/update-hf-deploy

Merge pull request #29 from Imaging-Plaza/update-hf-deploy #5

Workflow file for this run

name: Deploy to Hugging Face Space
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: false
- name: Prepare clean HF deploy branch without assets
run: |
git config user.email "ci@github.actions"
git config user.name "github-actions[bot]"
original_readme="$(cat README.md)"
cat > README.md <<EOF
---
title: AI Agent
emoji: 🤖
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
---
$original_readme
EOF
rm -rf assets
git checkout --orphan hf-deploy
git add -A
git commit -m "Deploy to Hugging Face Space"
- name: Push to HF Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git push --force \
https://SDSC:${HF_TOKEN}@huggingface.co/spaces/SDSC/ai-agent \
hf-deploy:main