Skip to content

Sync to Hugging Face Space #2

Sync to Hugging Face Space

Sync to Hugging Face Space #2

Workflow file for this run

name: Sync to Hugging Face Space
on:
release:
types: [published]
workflow_dispatch:
jobs:
sync-space:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git clone https://${{ secrets.HF_USERNAME }}:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/mozilla-ai/structured-qa hf-space
- run: |
cp demo/app.py hf-space/app.py
cp demo/Dockerfile hf-space/Dockerfile
- run: |
cd hf-space
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Sync with https://github.com/mozilla-ai/structured-qa"
- name: Push to Hugging Face
run: |
cd hf-space
git push https://${{ secrets.HF_USERNAME }}:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/mozilla-ai/structured-qa main
- name: Reboot Space
if: always()
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pip install huggingface_hub
python demo/reboot_space.py