Skip to content

Commit c646cdd

Browse files
Add CI/CD workflow for CypherTube project but
This workflow automates the CI/CD process for the CypherTube project, including steps for checking out the repository, setting up the Node.js environment, installing dependencies, running linting and security audits, executing tests, building artifacts, and uploading the build artifact.
1 parent f912731 commit c646cdd

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CypherTube CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js Environment
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci || npm install
26+
27+
- name: Run code linting & security audit
28+
run: |
29+
npm run lint --if-present
30+
npm audit --audit-level=high --if-present
31+
32+
- name: Run test suite
33+
run: npm test --if-present
34+
35+
- name: Build production artifacts
36+
run: npm run build --if-present
37+
38+
- name: Upload Build Artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: build-artifact
42+
path: dist/ # Adjust to 'build/' or public directory depending on your framework
43+
retention-days: 7

0 commit comments

Comments
 (0)