-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.28 KB
/
deploy_hf.yml
File metadata and controls
48 lines (40 loc) · 1.28 KB
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
name: Deploy to HuggingFace Spaces
on:
push:
branches: [main]
paths:
- "dashboard/**"
- "requirements.txt"
- "Dockerfile"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Push to HuggingFace Spaces
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
COMMIT_SHA=$(git rev-parse --short HEAD)
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"
git clone https://evgeniimatveevusa:$HF_TOKEN@huggingface.co/spaces/evgeniimatveevusa/uber-driver-analytics hf_space
cp Dockerfile hf_space/Dockerfile
cp requirements.txt hf_space/requirements.txt
cp -r dashboard hf_space/dashboard
{
echo '---'
echo 'title: Uber Driver Analytics'
echo 'emoji: 🚗'
echo 'colorFrom: gray'
echo 'colorTo: yellow'
echo 'sdk: docker'
echo 'app_port: 8501'
echo 'pinned: true'
echo '---'
} > hf_space/README.md
cd hf_space
git add -A
git diff --staged --quiet || git commit -m "Deploy from GitHub $COMMIT_SHA"
git push