name: Deploy to Hugging Face Space on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Git config run: | git config --global user.name "github-actions" git config --global user.email "ci@github.com" - name: Push to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git clone https://huggingface.co/spaces/tharunk07/weatherapplication space-repo rsync -av --exclude='.git' ./ space-repo/ cd space-repo git add . git commit -m "Auto-deploy from GitHub Actions" || echo "No changes to commit" git push https://huggingface:${HF_TOKEN}@huggingface.co/spaces/tharunk07/weatherapplication main