copilot modif #4
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: Deploy to Hugging Face Space | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - update-hf-deploy | |
| 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 |