jatinmehra's picture
fix: update workflow to temporarily replace README.md for Hugging Face and commit changes
ba58f89
name: Sync to Hugging Face Space
on:
push:
branches:
- main
permissions:
contents: write
jobs:
sync-to-space:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare Hugging Face README
run: |
# Temporarily replace README.md for Hugging Face
mv README_hf.md README.md
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: jatinmehra # Replace with your Hugging Face username
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git remote remove origin || true
git remote add origin "https://${HF_USERNAME}:${HF_TOKEN}@huggingface.co/spaces/jatinmehra/CRAWL-GPT-CHAT"
git add README.md
git commit -m "Update Hugging Face README" || true
git push origin main || (git branch -M main && git push -f origin main)