name: Sync to Hugging Face hub on: push: branches: - main - demo-icpm24 # to run this workflow manually from the Actions tab workflow_dispatch: jobs: sync-to-hub: runs-on: ubuntu-latest steps: - name: Check large files uses: ActionsDesk/lfs-warning@v2.0 with: filesizelimit: 10485760 # this is 10MB so we can sync to HF Spaces - uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true - name: Set current branch as a variable id: set_branch run: echo "CURRENT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: Push to hub env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: git push --force https://andreamalhera:$HF_TOKEN@huggingface.co/spaces/${{ secrets.HF_SPACE }} $CURRENT_BRANCH:main