Skip to content

Commit 601b81b

Browse files
improve CI/CD
1 parent cea3041 commit 601b81b

File tree

2 files changed

+75
-32
lines changed

2 files changed

+75
-32
lines changed

.github/workflows/ci-cd.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "24"
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Check code formatting
35+
run: npm run format:check
36+
37+
- name: Run ESLint
38+
run: npm run lint
39+
40+
- name: Run Tests
41+
run: npm test -- --coverage
42+
43+
- name: Upload Test Coverage Artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: jest-coverage-report
47+
path: coverage/
48+
49+
build:
50+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51+
runs-on: ubuntu-latest
52+
needs: test
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
57+
- name: Setup Pages
58+
uses: actions/configure-pages@v4
59+
60+
- name: Upload artifact
61+
uses: actions/upload-pages-artifact@v3
62+
with:
63+
path: "./src"
64+
65+
deploy:
66+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
67+
environment:
68+
name: github-pages
69+
url: ${{ steps.deployment.outputs.page_url }}
70+
runs-on: ubuntu-latest
71+
needs: build
72+
steps:
73+
- name: Deploy to GitHub Pages
74+
id: deployment
75+
uses: actions/deploy-pages@v4

.github/workflows/ci.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)