Skip to content

Commit becc588

Browse files
committed
Add simplified CI/CD workflow with Hugging Face CLI
- Use Hugging Face CLI for deployment (more reliable than git) - Basic syntax checking only (removed complex testing) - Simplified workflow for better reliability - Focus on essential CI/CD components
1 parent fdf733d commit becc588

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.10'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r requirements.txt
26+
27+
- name: Syntax check only
28+
run: |
29+
python -m py_compile app.py
30+
echo "✅ Syntax check passed"
31+
32+
deploy:
33+
needs: test
34+
runs-on: ubuntu-latest
35+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Install Hugging Face CLI
42+
run: |
43+
pip install huggingface_hub
44+
45+
- name: Deploy to Hugging Face Spaces
46+
env:
47+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
48+
run: |
49+
# Deploy using Hugging Face CLI
50+
huggingface-cli login --token $HF_TOKEN
51+
huggingface-cli upload nellaivijay/research-assistant . --repo-type space --commit-message "Deploy from GitHub Actions"
52+
53+
echo "✅ Deployed to Hugging Face Spaces using CLI"

0 commit comments

Comments
 (0)