name: Sync to Hugging Face space on: push: branches: [main] # to run this workflow manually from the Actions tab workflow_dispatch: jobs: sync-to-hub: runs-on: ubuntu-latest steps: - name: Checkout the 'spaces' branch uses: actions/checkout@v3 with: ref: 'spaces' fetch-depth: 0 lfs: true - name: Overwrite 'spaces' with 'main' run: | git fetch origin main:main git reset --hard main - name: Delete 'README.md' run: | rm -f README.md - name: Rename 'spaces.md' to 'README.md' run: | mv spaces.md README.md - name: Add all files and commit to 'spaces' run: | git add . git config --global user.email "anoori@college.harvard.edu" git config --global user.name "Ayush Noori" git commit -m "Sync main content to spaces" - name: Push to Hugging Face env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: git push https://ayushnoori:$HF_TOKEN@huggingface.co/spaces/ayushnoori/program-synthesis main --force