-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathdeploy_method_comparison_app.yml
More file actions
43 lines (38 loc) · 1.45 KB
/
deploy_method_comparison_app.yml
File metadata and controls
43 lines (38 loc) · 1.45 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
name: Deploy "method_comparison" Gradio to Spaces
on:
push:
branches: [ main ]
paths:
- "method_comparison/**"
workflow_dispatch:
permissions: {}
jobs:
deploy:
# GH Environment for extra protection: https://github.com/huggingface/peft/settings/environments
environment: branch-protection-main
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # full history needed for subtree
persist-credentials: false
- name: Authenticate via ~/.netrc
env:
HF_TOKEN: ${{ secrets.PEFT_INTERNAL_REPO_READ_WRITE }}
run: |
# netrc needs BOTH login and password entries
printf "machine huggingface.co\nlogin hf\npassword ${HF_TOKEN}\n" >> ~/.netrc
chmod 600 ~/.netrc
- name: Deploy method_comparison app to HF Spaces
run: |
cd method_comparison
git init
# Spaces expect requirements.txt
mv requirements-app.txt requirements.txt
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add gradio-app https://huggingface.co/spaces/peft-internal-testing/PEFT-method-comparison
git add .
git commit -m "🚀 Deploy method comparison app from GH action"
git push -f gradio-app HEAD:main