name: Sync to Hugging Face hub 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 code uses: actions/checkout@v3 with: # Disabling shallow clone is recommended for improving relevancy of # commitlint and git log checks fetch-depth: 0 - name: Configure Git env: USER_NAME: ${{ secrets.USER_NAME }} USER_EMAIL: ${{ secrets.USER_EMAIL }} run: | git config user.name $USER_NAME git config user.email $USER_EMAIL - name: Push to hub env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git push --force https://anurag629:$HF_TOKEN@huggingface.co/spaces/anurag629/botaniscan main