muddasser commited on
Commit
6cf810e
·
unverified ·
1 Parent(s): 47f98c2

Refactor deploy.yml for clarity and simplicity

Browse files

Updated workflow names and simplified syntax for clarity. Adjusted HF_TOKEN usage and improved command structure.

Files changed (1) hide show
  1. .github/workflows/deploy.yml +14 -18
.github/workflows/deploy.yml CHANGED
@@ -1,17 +1,13 @@
1
- name: CICD Travel Prophet
2
 
3
  on:
4
  push:
5
  branches:
6
  - main
7
- pull_request:
8
- branches:
9
- - main
10
 
11
  jobs:
12
  test:
13
  runs-on: ubuntu-latest
14
-
15
  steps:
16
  - uses: actions/checkout@v3
17
 
@@ -19,36 +15,36 @@ jobs:
19
  with:
20
  python-version: "3.10"
21
 
22
- - name: Install Dependencies
23
  run: pip install -r requirements.txt && pip install pytest
24
 
25
- - name: Run Tests
26
  run: pytest tests/ -v
27
 
28
  deploy:
29
  runs-on: ubuntu-latest
30
  needs: test
31
  if: github.ref == 'refs/heads/main'
32
-
33
  steps:
34
  - uses: actions/checkout@v3
35
 
36
- - name: Configure Git
37
  run: |
38
  git config --global user.email "ci@github.com"
39
  git config --global user.name "GitHub CI"
40
 
41
- - name: Push to Hugging Face
42
- run: git remote add huggingface https://muddasser:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/muddasser/ci_cd_prophet && git push huggingface main --force
 
 
 
 
43
  ```
44
 
45
  ---
46
 
47
- ### Key Changes Made
48
  ```
49
- Removed special characters from name
50
- Simplified branch syntax
51
- Merged run commands to avoid line issues
52
- ✅ Fixed HF_TOKEN syntax
53
- ✅ Removed emoji from step names
54
- ✅ Shorter cleaner file
 
1
+ name: CICD Prophet
2
 
3
  on:
4
  push:
5
  branches:
6
  - main
 
 
 
7
 
8
  jobs:
9
  test:
10
  runs-on: ubuntu-latest
 
11
  steps:
12
  - uses: actions/checkout@v3
13
 
 
15
  with:
16
  python-version: "3.10"
17
 
18
+ - name: Install
19
  run: pip install -r requirements.txt && pip install pytest
20
 
21
+ - name: Test
22
  run: pytest tests/ -v
23
 
24
  deploy:
25
  runs-on: ubuntu-latest
26
  needs: test
27
  if: github.ref == 'refs/heads/main'
 
28
  steps:
29
  - uses: actions/checkout@v3
30
 
31
+ - name: Git Config
32
  run: |
33
  git config --global user.email "ci@github.com"
34
  git config --global user.name "GitHub CI"
35
 
36
+ - name: Push to HF
37
+ env:
38
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
39
+ run: |
40
+ git remote add hf https://muddasser:${HF_TOKEN}@huggingface.co/spaces/muddasser/ci_cd_prophet
41
+ git push hf main --force
42
  ```
43
 
44
  ---
45
 
46
+ ### Key Fix
47
  ```
48
+ Split the long command into
49
+ two separate lines under run: |
50
+ instead of one long line