Skip to content

Commit bcfd3c2

Browse files
Create main.yml
1 parent ba93e57 commit bcfd3c2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 'CI/CD'
2+
on:
3+
push:
4+
branches: [master, main]
5+
pull_request:
6+
branches: [master, main]
7+
jobs:
8+
lint_js:
9+
name: Lint JavaScript Files
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v3
14+
- name: Install Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 14
18+
- name: Install JSHint
19+
run: npm install jshint --global
20+
- name: Run Linter
21+
run: |
22+
# This command finds all JavaScript files recursively and runs JSHint on them
23+
find ./giftlink-backend -name app.js -exec jshint {} +
24+
find ./giftlink-backend -name auth.js -exec jshint {} +
25+
find ./giftlink-backend -name giftRoutes.js -exec jshint {} +
26+
find ./giftlink-backend -name searchRoutes.js -exec jshint {} +
27+
echo "Linted all the js files successfully"
28+
client_build:
29+
name: Build client
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout Repository
33+
uses: actions/checkout@v3
34+
- name: Install Node.js
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 14
38+
- name: Run build
39+
run: |
40+
cd giftlink-frontend
41+
npm install
42+
npm run build
43+
echo "Client-side build successfully"

0 commit comments

Comments
 (0)