name: Deploy to Hugging Face Hub on: push: branches: - main paths: - app.py workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ uses: actions/checkout@v3 with: fetch-depth: 0 - name: Push to HF ⬆️ env: HF_TOKEN: ${{ secrets.HF_TOKEN }} HF_USERNAME: itsyoboieltr HF_SPACE: itsyoboieltr/anpr TARGET_BRANCH: main run: | rm -fr .git git config --global init.defaultBranch main git config --global user.email "itsyoboieltr@users.noreply.github.com" git config --global user.name "itsyoboieltr" git init git add . :^main/ANPR.ipynb git commit -m "${{ github.event.head_commit.message }}" git remote add space https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_SPACE git push --force space $TARGET_BRANCH