| |
| name: Sync to Hugging Face Space |
|
|
| on: |
| push: |
| branches: |
| - main |
|
|
| jobs: |
| sync: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v3 |
| with: |
| fetch-depth: 0 |
| lfs: true |
|
|
| - name: Push to Hugging Face Space |
| env: |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| HF_USERNAME: GuitarGeorge |
| SPACE_ID: GuitarGeorge/Neural-Prophet-Predictor |
| run: | |
| echo "Attempting to push to Hugging Face Space: $SPACE_ID" |
| |
| |
| git config --global user.email "action@github.com" |
| git config --global user.name "GitHub Action" |
|
|
| |
| |
| git remote add hf_space "https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$SPACE_ID" |
| |
| |
| git config --global --unset credential.helper || true |
| |
| |
| |
| git push --force hf_space HEAD:refs/heads/main |
| |
| echo "Push to Hugging Face Space completed." |