UdasriHasindu commited on
Commit ·
b92c22f
1
Parent(s): 1be6770
fix: actions
Browse files1234567891011121314151617181920212223242526name: Sync to Hugging Face Spaceson:push:branches: [main, master]# Allows you to trigger this workflow manually from the Actions tabworkflow_dispatch:jobs:deploy-to-space:runs-on: ubuntu-lateststeps:- name: Checkout Repositoryuses: actions/checkout@v4with:fetch-depth: 0 # Required to grab all commit historylfs: true # Tells git to fetch those large LFS objects- name: Push to Hugging Face Hubenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}# Update these exact two variables below with your HF handle and Space Name!HF_USERNAME: xplorersSPACE_NAME: MIS_APIrun: |git push --force "https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME"123456789101112131415161718192021222324- name: Push to Hugging Face Hubenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}HF_USERNAME: xplorersSPACE_NAME: MIS_APIrun: |set -euo pipefail- name: Push to Hugging Face Hubenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}HF_USERNAME: xplorersSPACE_NAME: MIS_APIrun: |set -euo pipefail# Strip possible CR/LF just in case the secret was pasted with a trailing newlineHF_TOKEN="$(printf '%s' "$HF_TOKEN" | tr -d '\r\n')"git remote remove hf 2>/dev/null || remote="https://huggingface.co/spaces/${HF_USERNAME}/${SPACE_NAME}"# Use the token via HTTP header (no URL parsing issues)git -c http.extraheader="Authorization: Bearer ${HF_TOKEN}" \push --force "${remote}" HEAD:main
.github/workflows/deploy.yml+21-23