|
|
name: Sync to Hugging Face |
|
|
|
|
|
on: |
|
|
push: |
|
|
branches: |
|
|
- main |
|
|
|
|
|
jobs: |
|
|
sync: |
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
steps: |
|
|
- name: Checkout repository |
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
- name: Set up Python |
|
|
uses: actions/setup-python@v4 |
|
|
with: |
|
|
python-version: '3.9' |
|
|
|
|
|
- name: Install dependencies |
|
|
run: | |
|
|
pip install huggingface_hub |
|
|
|
|
|
- name: Sync to Hugging Face |
|
|
env: |
|
|
HF_TOKEN: ${{ secrets.HF_TOKEN }} |
|
|
run: | |
|
|
# Configure git |
|
|
git config --global user.email "myronzhangweb3@gmail.com" |
|
|
git config --global user.name "Myron Zhang" |
|
|
|
|
|
|
|
|
git clone https://myronzhangweb3:$HF_TOKEN@huggingface.co/spaces/PrivEcho/encrypted_sentiment_analysis hf_repo |
|
|
cd hf_repo |
|
|
|
|
|
|
|
|
rsync -av --exclude='.git' ../ . |
|
|
|
|
|
|
|
|
git add . |
|
|
git commit -m "Sync from GitHub" |
|
|
git push |