File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ # .github/workflows/ci-cd.yml
2
+ name : CI/CD for Trading Bot
3
+
4
+ on :
5
+ push :
6
+ branches :
7
+ - main # Run workflow on pushes to main branch
8
+ pull_request :
9
+ branches :
10
+ - main # Run workflow for pull requests targeting main
11
+
12
+ jobs :
13
+ # Job to install dependencies and run tests
14
+ test :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Checkout Code
18
+ uses : actions/checkout@v3
19
+
20
+ - name : Set up Python
21
+ uses : actions/setup-python@v4
22
+ with :
23
+ python-version : ' 3.9'
24
+
25
+ - name : Install Dependencies
26
+ run : |
27
+ python -m pip install --upgrade pip
28
+ pip install -r requirements.txt
29
+
30
+ - name : Run Tests
31
+ run : |
32
+ pytest --disable-warnings
33
+
34
+ # Job to deploy code if tests pass
35
+ deploy :
36
+ runs-on : ubuntu-latest
37
+ needs : test # Only runs if the test job succeeds
38
+ steps :
39
+ - name : Checkout Code
40
+ uses : actions/checkout@v3
41
+
42
+ - name : Set up Python
43
+ uses : actions/setup-python@v4
44
+ with :
45
+ python-version : ' 3.9'
46
+
47
+ - name : Install Dependencies
48
+ run : |
49
+ python -m pip install --upgrade pip
50
+ pip install -r requirements.txt
51
+
52
+ - name : Deploy Application
53
+ env :
54
+ DHAN_API_KEY : ${{ secrets.DHAN_API_KEY }}
55
+ DHAN_SECRET_KEY : ${{ secrets.DHAN_SECRET_KEY }}
56
+ CHATGPT_API_KEY : ${{ secrets.CHATGPT_API_KEY }}
57
+ run : |
58
+ # Deploy command or script here
59
+ echo "Deployment step - Placeholder. Add actual deployment commands here."
You can’t perform that action at this time.
0 commit comments