Skip to content

Commit 2b4d5ef

Browse files
authored
Merge pull request #3 from Groupify-SCE/feature/setup-cicd
Feature/setup cicd
2 parents c70ca6a + df41a39 commit 2b4d5ef

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

.github/workflows/cicd.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: "CICD"
2+
3+
on:
4+
push:
5+
branches:
6+
- stage
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
24+
- name: Install Dependencies
25+
run: npm install
26+
27+
- name: Run Build
28+
run: npm run build
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout Code
34+
uses: actions/checkout@v3
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v3
38+
with:
39+
node-version: 18
40+
41+
- name: Install Dependencies
42+
run: npm install
43+
44+
- name: Run Test
45+
run: npm test
46+
47+
lint:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout Code
51+
uses: actions/checkout@v3
52+
53+
- name: Setup Node.js
54+
uses: actions/setup-node@v3
55+
with:
56+
node-version: 18
57+
58+
- name: Install Dependencies
59+
run: npm install
60+
61+
- name: Run Lint
62+
run: npm run lint
63+
64+
deploy:
65+
needs: [build, test, lint]
66+
runs-on: ubuntu-latest
67+
if: github.ref == 'refs/heads/main'
68+
steps:
69+
- name: Deploy
70+
run: curl -X POST "$DEPLOY_URL"
71+
env:
72+
DEPLOY_URL: ${{ secrets.DEPLOY_URL }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ out
9696
# Nuxt.js build / generate output
9797
.nuxt
9898
dist
99+
build
99100

100101
# Gatsby files
101102
.cache/
@@ -528,4 +529,4 @@ MigrationBackup/
528529
# Ionide (cross platform F# VS Code tools) working folder
529530
.ionide/
530531

531-
# End of https://www.toptal.com/developers/gitignore/api/vs,visualstudiocode,react,node,dotenv
532+
# End of https://www.toptal.com/developers/gitignore/api/vs,visualstudiocode,react,node,dotenv

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"scripts": {
1818
"start": "react-scripts start",
1919
"build": "react-scripts build",
20-
"test": "react-scripts test",
20+
"test": "react-scripts test --watchAll=false --silent",
2121
"eject": "react-scripts eject",
2222
"lint": "eslint --ext .js,.jsx src",
2323
"lint:fix": "eslint --fix --ext .js,.jsx src"

0 commit comments

Comments
 (0)