name: Deploy to Hugging Face Space on: push: branches: - main paths-ignore: - '**.md' - 'LICENSE' - '.vscode/**' - '.gitignore' # Allow manual triggering from the GitHub Actions tab workflow_dispatch: jobs: sync-to-hub: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 # Required to push history lfs: true # Required if you have large files tracked by Git LFS - name: Push to Hugging Face Hub env: HF_TOKEN: ${{ secrets.HF_TOKEN }} # Update the SPACE_ID if your Hugging Face username or space name is different SPACE_ID: "Jaleed02/AI-notes-agent" run: | # Configure git identity for the action git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" # Add Hugging Face remote using the secret token git remote add hf https://Jaleed02:$HF_TOKEN@huggingface.co/spaces/$SPACE_ID # Push to the Hugging Face Space git push --force hf main