Skip to content

Commit e25dc5d

Browse files
authored
Update action.yml
1 parent db9698b commit e25dc5d

File tree

1 file changed

+49
-54
lines changed

1 file changed

+49
-54
lines changed

action.yml

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,55 @@ branding:
55
icon: upload-cloud
66
color: yellow
77

8-
on:
9-
workflow_call:
10-
inputs:
11-
github_repo_id:
12-
required: true
13-
type: string
14-
subdirectory:
15-
type: string
16-
default: ''
17-
huggingface_repo_id:
18-
required: true
19-
type: string
20-
repo_type:
21-
type: string
22-
default: 'space'
23-
space_sdk:
24-
type: string
25-
default: 'gradio'
26-
private:
27-
type: boolean
28-
default: false
29-
secrets:
30-
hf_token:
31-
required: true
8+
inputs:
9+
github_repo_id:
10+
required: true
11+
type: string
12+
subdirectory:
13+
type: string
14+
default: ''
15+
huggingface_repo_id:
16+
required: true
17+
type: string
18+
hf_token:
19+
required: true
20+
repo_type:
21+
type: string
22+
default: 'space'
23+
space_sdk:
24+
type: string
25+
default: 'gradio'
26+
private:
27+
type: boolean
28+
default: false
3229

33-
jobs:
34-
sync_with_huggingface:
35-
runs-on: ubuntu-latest
30+
runs:
31+
using: "composite"
32+
steps:
33+
- name: Checkout Action GitHub Repo
34+
uses: actions/checkout@v2
35+
with:
36+
repository: 'nateraw/spaces-action'
37+
path: cloned_hf_action_repo
3638

37-
steps:
38-
- name: Checkout Action GitHub Repo
39-
uses: actions/checkout@v2
40-
with:
41-
repository: 'nateraw/spaces-action'
42-
path: cloned_hf_action_repo
39+
- name: Checkout Source GitHub Repo to Push
40+
uses: actions/checkout@v2
41+
with:
42+
repository: '${{ inputs.github_repo_id }}'
43+
# Relative path under $GITHUB_WORKSPACE to place the repository
44+
path: cloned_github_repo
4345

44-
- name: Checkout Source GitHub Repo to Push
45-
uses: actions/checkout@v2
46-
with:
47-
repository: '${{ inputs.github_repo_id }}'
48-
# Relative path under $GITHUB_WORKSPACE to place the repository
49-
path: cloned_github_repo
50-
51-
- name: Push to hub
52-
shell: bash
53-
run: |
54-
cd cloned_hf_action_repo
55-
git pull origin main
56-
pip install -r requirements.txt
57-
cd ..
58-
python cloned_hf_action_repo/sync_with_spaces.py \
59-
--repo_id ${{ inputs.huggingface_repo_id }} \
60-
--directory "cloned_github_repo/${{ inputs.subdirectory }}" \
61-
--token ${{ secrets.hf_token }} \
62-
--repo_type ${{ inputs.repo_type }} \
63-
--space_sdk ${{ inputs.space_sdk }} \
64-
--private ${{ inputs.private }}
46+
- name: Push to hub
47+
shell: bash
48+
run: |
49+
cd cloned_hf_action_repo
50+
git pull origin main
51+
pip install -r requirements.txt
52+
cd ..
53+
python cloned_hf_action_repo/sync_with_spaces.py \
54+
--repo_id ${{ inputs.huggingface_repo_id }} \
55+
--directory "cloned_github_repo/${{ inputs.subdirectory }}" \
56+
--token ${{ inputs.hf_token }} \
57+
--repo_type ${{ inputs.repo_type }} \
58+
--space_sdk ${{ inputs.space_sdk }} \
59+
--private ${{ inputs.private }}

0 commit comments

Comments
 (0)