forked from weaigc/bingo
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.09 KB
/
sync-endpoint.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
name: Sync Endpoint
on:
schedule:
- cron: '* */24 * * *'
jobs:
sync-to-hub:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore cache
id: file-restore
uses: actions/cache/restore@v3
with:
path: |
sync/endpoint.txt
key: endpoint
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: run
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
ENDPOINTS: ${{ vars.ENDPOINTS }}
run: cd sync && pip install huggingface_hub && python sync.py && cat endpoint.txt
- name: Delete cache
run: |
gh extension install actions/gh-actions-cache
set +e
echo "Deleting cache..."
gh actions-cache delete endpoint -R ${{ github.repository }} --confirm
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save cache
if: always()
id: file-save
uses: actions/cache/save@v3
with:
path: |
sync/endpoint.txt
key: endpoint