ashishbaberwal's picture
hf sync
7e1da1e
raw
history blame contribute delete
900 Bytes
name: Sync to Hugging Face Space
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: sync-to-hf-space
cancel-in-progress: true
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Add Hugging Face remote
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git remote add hf "https://Spirit-26:${HF_TOKEN}@huggingface.co/spaces/Spirit-26/code-review-environment"
git fetch hf main
- name: Push to Hugging Face Space
run: |
git push --force-with-lease hf HEAD:main