fahadcr14 commited on
Commit
d3e5bda
·
2 Parent(s): 7b26e4e 77f4f41

Merge branch 'main' of https://github.com/fahadcr14/mlactions

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yml +45 -0
.github/workflows/main.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to Hugging Face Space
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ # Step 1: Checkout the repository
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v3
16
+
17
+ # Step 2: Set up Python environment
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: 3.8
22
+
23
+ # Step 3: Install dependencies
24
+ - name: Install dependencies
25
+ run: |
26
+ pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Step 4: Authenticate Hugging Face CLI
29
+ - name: Authenticate Hugging Face CLI
30
+ env:
31
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
32
+ run: huggingface-cli login --token $HF_TOKEN
33
+
34
+ # Step 5: Push application files to Hugging Face Space
35
+ - name: Push Files to Hugging Face Space
36
+ env:
37
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
38
+ run: |
39
+ huggingface-cli repo create fahd9999/resultprediction --type=space --yes
40
+ git clone https://huggingface.co/spaces/fahd9999/resultprediction
41
+ cp -r * resultprediction
42
+ cd resultprediction
43
+ git add .
44
+ git commit -m "Deploy application to Hugging Face Space"
45
+ git push