abdullah090809 commited on
Commit
6d7787d
·
1 Parent(s): dcfd930

Added CD to Hugging Face

Browse files
Files changed (1) hide show
  1. .github/workflows/build-deploy.yml +24 -0
.github/workflows/build-deploy.yml CHANGED
@@ -6,6 +6,7 @@ jobs:
6
  job1:
7
  environment:
8
  name: testing
 
9
  env:
10
  DATABASE_HOSTNAME: localhost
11
  DATABASE_PORT: 5432
@@ -32,6 +33,7 @@ jobs:
32
  --health-retries 5
33
 
34
  runs-on: ubuntu-latest
 
35
  steps:
36
  - name: Pulling Code
37
  uses: actions/checkout@v4
@@ -49,3 +51,25 @@ jobs:
49
 
50
  - name: Run tests
51
  run: pytest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  job1:
7
  environment:
8
  name: testing
9
+
10
  env:
11
  DATABASE_HOSTNAME: localhost
12
  DATABASE_PORT: 5432
 
33
  --health-retries 5
34
 
35
  runs-on: ubuntu-latest
36
+
37
  steps:
38
  - name: Pulling Code
39
  uses: actions/checkout@v4
 
51
 
52
  - name: Run tests
53
  run: pytest
54
+
55
+ deploy:
56
+ runs-on: ubuntu-latest
57
+ needs: [job1]
58
+
59
+ environment:
60
+ name: deploy
61
+
62
+ steps:
63
+ - name: Pulling code
64
+ uses: actions/checkout@v4
65
+ with:
66
+ fetch-depth: 0
67
+
68
+ - name: Push to Hugging Face
69
+ env:
70
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
71
+ run: |
72
+ git config --global user.email "ci@github.com"
73
+ git config --global user.name "GitHub Actions"
74
+ git remote add hf https://abdullah090809:$HF_TOKEN@huggingface.co/spaces/abdullah090809/fastapi-project
75
+ git push hf main --force