name: Deploy to Hugging Face Spaces on: push: branches: - main workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true - name: Set up Python uses: actions/setup-python@v3 with: python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Push to Hugging Face Spaces env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git remote add space https://huggingface.co/spaces/HF_USERNAME/SPACE_NAME git push https://HF_USERNAME:${HF_TOKEN}@huggingface.co/spaces/HF_USERNAME/SPACE_NAME main