1- name : Workflow App CI/CD
1+ name : Nodejs
22
33on :
44 push :
5- branches : [ " main", "development" ]
5+ branches : [main]
66 pull_request :
7- branches : [ " main", "development" ]
7+ branches : [main]
88
99jobs :
10- build-and-test :
10+ build-python :
1111 runs-on : ubuntu-latest
12+
1213 strategy :
1314 matrix :
14- node -version : [18.x, 20.x, 22.x ]
15+ python -version : [3.9, 11, 12 ]
1516
1617 steps :
17- - name : Checkout Repository
18- uses : actions/checkout@v4
19-
20- - name : Set up Node.js ${{ matrix.node-version }}
21- uses : actions/setup-node@v4
22- with :
23- node-version : ${{ matrix.node-version }}
24- cache : " npm"
18+ - name : Checkout code
19+ uses : actions/checkout@v2
2520
26- - name : Install Dependencies
27- run : npm ci
21+ - name : Set up Python ${{ matrix.python-version }}
22+ uses : actions/setup-python@v2
23+ with :
24+ python-version : ${{ matrix.python-version }}
2825
29- - name : Build the App
30- run : npm run build --if-present
26+ - name : Install dependencies
27+ run : |
28+ python -m pip install --upgrade pip
29+ pip install wheel
30+ pip install -r requirements.txt
3131
32- - name : Run Tests
33- run : npm test
32+ - name : Run tests
33+ run : |
34+ pytest
3435
35- - name : Upload Build Artifacts
36- uses : actions/upload-artifact@v4
37- with :
38- name : build-artifacts
39- path : dist/
40-
41- run-shell-scripts :
42- needs : build-and-test
36+ build-node :
4337 runs-on : ubuntu-latest
4438
45- steps :
46- - name : Checkout Repository
47- uses : actions/checkout@v4
48-
49- - name : Grant Execute Permissions to Shell Scripts
50- run : chmod +x startup.sh git.sh dev.sh api.sh
51-
52- - name : Run startup.sh
53- run : ./startup.sh
54-
55- - name : Run git.sh
56- run : ./git.sh
57-
58- - name : Run dev.sh
59- run : ./dev.sh
60-
61- - name : Run api.sh
62- run : ./api.sh
39+ strategy :
40+ matrix :
41+ node-version : [20, 22, 23]
6342
64- - name : Upload Logs (if needed)
65- uses : actions/upload-artifact@v4
66- with :
67- name : execution-logs
68- path : logs/
43+ steps :
44+ - name : Checkout code
45+ uses : actions/checkout@v2
6946
70- deploy :
71- needs : run-shell-scripts
72- runs-on : ubuntu-latest
73- if : github.ref == 'refs/heads/main'
47+ - name : Set up Node.js ${{ matrix.node-version }}
48+ uses : actions/setup-node@v2
49+ with :
50+ node-version : ${{ matrix.node-version }}
7451
75- steps :
76- - name : Checkout Repository
77- uses : actions/checkout@v4
52+ - name : Install dependencies
53+ run : npm install
7854
79- - name : Deploy to GitHub Pages
80- uses : JamesIves/github-pages-deploy-action@v4
81- with :
82- branch : gh-pages
83- folder : dist
84- token : ${{ secrets.GITHUB_TOKEN }}
55+ - name : Run tests
56+ run : npm test
0 commit comments