Skip to content

Commit bf9d42c

Browse files
committed
Added a CI/CD WorkFlow That Triggers Automated Deployment in HF Spaces
1 parent fdeb478 commit bf9d42c

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy to Hugging Face Spaces
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Push to Hugging Face Spaces
17+
env:
18+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
19+
run: |
20+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
21+
git config --global user.name "github-actions[bot]"
22+
23+
git remote add hf https://Abeshith:$HF_TOKEN@huggingface.co/spaces/Abeshith/RAG-Project
24+
25+
# Only push necessary files
26+
git add project/ templates/ static/ app.py Dockerfile requirements.txt .dockerignore README.md
27+
28+
# Push to HF Space
29+
git push hf main:main --force

0 commit comments

Comments
 (0)