Skip to content

Commit

Permalink
Update deploy-hf.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
3377 authored Sep 11, 2024
1 parent 923832d commit 17e0b50
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/deploy-hf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,18 @@ jobs:
- name: Install Python dependencies
run: pip install --upgrade huggingface_hub

- name: Create and upload Dockerfile
- name: Create Dockerfile
run: |
echo 'FROM drfyup/rss2tg:latest' > Dockerfile
- name: Deploy to Hugging Face Spaces
- name: Upload Dockerfile to Hugging Face Spaces
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
SPACE_ID: drfy/rss2tg # 替换为你的Space ID,例如 `username/my-space`
run: |
python -c "
from huggingface_hub import HfApi
api = HfApi()
api.create_repo(
repo_id='${{ env.SPACE_ID }}',
repo_type='space',
token='${{ secrets.HF_TOKEN }}',
space_sdk='docker'
)
api.upload_file(
path_or_fileobj='Dockerfile',
path_in_repo='Dockerfile',
Expand Down

0 comments on commit 17e0b50

Please sign in to comment.