|
name: Deploy to Hugging Face Space |
|
|
|
on: |
|
workflow_dispatch: |
|
pull_request: |
|
branches: [main] |
|
|
|
|
|
|
|
jobs: |
|
sync: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Checkout repository |
|
uses: actions/checkout@v4 |
|
with: |
|
fetch-depth: 0 |
|
|
|
- name: Configure Git |
|
run: | |
|
git config --global user.email "github-actions[bot]@users.noreply.github.com" |
|
git config --global user.name "github-actions[bot]" |
|
|
|
- name: Set up Python |
|
uses: actions/setup-python@v4 |
|
with: |
|
python-version: "3.x" |
|
|
|
- name: Install Hugging Face CLI |
|
run: | |
|
pip install --upgrade huggingface-hub |
|
|
|
- name: Login to Hugging Face |
|
env: |
|
HF_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN }} |
|
run: | |
|
huggingface-cli login --token $HF_TOKEN --add-to-git-credential |
|
|
|
- name: Push to Hugging Face Space |
|
env: |
|
HF_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN }} |
|
run: | |
|
git remote add space "https://JeffYang52415:[email protected]/spaces/JeffYang52415/LLMEval-Dataset-Parser" || true |
|
git fetch space || true |
|
git push -f space main:main |
|
|