name: Update Space on: push: branches: - main jobs: sync-to-hub: runs-on: ubuntu-latest strategy: matrix: space_name: [company-pet-policy, about-mls, shakespeare] # List your Hugging Face space names here steps: - name: Checkout repository uses: actions/checkout@v2 with: fetch-depth: 0 lfs: true - name: Configure Git run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - name: Get changed files id: changed_files run: | git fetch origin echo "::set-output name=value::$(git diff --name-only HEAD~1 HEAD || true)" - name: Show changed files run: | echo "Changed files:" echo "${{ steps.changed_files.outputs.value }}" - name: Push changed files to Hugging Face env: HF_TOKEN: ${{ secrets.HF_TOKEN }} # Your Hugging Face token secret run: | changed_files="${{ steps.changed_files.outputs.value }}" echo "Files to push: $changed_files" git push --force https://david-oplatka:$HF_TOKEN@huggingface.co/spaces/david-oplatka/${{ matrix.space_name }}.git HEAD:main