Skip to content

Commit 44fae39

Browse files
authored
Merge pull request #79 from badhonparvej481/devops
Devops
2 parents ce88dda + d927eab commit 44fae39

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

.github/workflows/cicd_dev.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Nur UI CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
env:
12+
NODE_VERSION: '20'
13+
14+
jobs:
15+
lint:
16+
name: 🧹 Lint code
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Use Node.js ${{ env.NODE_VERSION }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ env.NODE_VERSION }}
25+
cache: yarn
26+
- run: yarn install --frozen-lockfile
27+
- run: yarn lint
28+
29+
test:
30+
name: 🧪 Run tests
31+
runs-on: ubuntu-latest
32+
needs: lint
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v3
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: "20"
41+
cache: "yarn"
42+
43+
- name: Install dependencies
44+
run: yarn install
45+
46+
- name: Run lint
47+
run: yarn lint
48+
49+
# Replace with your actual test command if you add test framework (e.g. jest)
50+
- name: Run tests
51+
run: echo "No tests yet" && exit 0
52+
53+
build:
54+
name: 🛠️ Build Project
55+
runs-on: ubuntu-latest
56+
needs: test
57+
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v3
61+
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: "20"
66+
cache: "yarn"
67+
68+
- name: Install dependencies
69+
run: yarn install
70+
71+
- name: Build the app
72+
run: yarn build
73+
74+
# - name: Upload build artifacts
75+
# uses: actions/upload-artifact@v4
76+
# with:
77+
# name: nextjs-build
78+
# path: .next/
79+
80+
deploy:
81+
name: 🚀 Deploy to Vercel
82+
runs-on: ubuntu-latest
83+
needs: build
84+
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v3
88+
89+
# - name: Install Vercel CLI
90+
# run: npm install -g vercel
91+
92+
# - name: Deploy to Vercel
93+
# run: vercel --prod --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)