Topic_Modeling_AI / .github /workflows /deploy_to_hf.yml
Mostafa174's picture
redeploy
e53edaf
raw
history blame
949 Bytes
name: Sync to Hugging Face Space
on:
push:
branches:
- main
workflow_dispatch:
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
lfs: true
fetch-depth: 0
- name: Set up git
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
SPACE_URL="https://huggingface.co/spaces/Mostafa174/Topic_Modeling_AI"
# Clean remote if it already exists
git remote remove space 2>/dev/null || true
git remote add space $SPACE_URL
git remote -v
# Push securely using token
git push --force https://user:$HF_TOKEN@huggingface.co/spaces/Mostafa174/Topic_Modeling_AI HEAD:main