-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (41 loc) · 1.45 KB
/
sync_to_hf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
##### Sync to Hugging Face Hub #####
# secrets:
# - HF_TOKEN: Hugging Face API token
####################################
name: Sync to Hugging Face Hub
on:
push:
branches: [ main ]
workflow_dispatch: # to run this workflow manually from the Actions tab
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.8'
- run: poetry --help
- name: Generate requirements.txt
run: poetry export --without-hashes --without dev -f requirements.txt -o requirements.txt
- name: Commit requirements.txt and packages.txt
run: |
touch packages.txt
echo "graphviz" >> packages.txt
echo "graphviz-dev" >> packages.txt
git add requirements.txt packages.txt
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -m "auto-setup HF Space (Gradio): requirements.txt, packages.txt"
- name: Push to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: git push https://naskio:$HF_TOKEN@huggingface.co/spaces/naskio/mergeui main --force