Skip to content

Commit 147b8ed

Browse files
committed
Add Docker configuration and CI/CD pipeline
1 parent b94dd51 commit 147b8ed

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.git
2+
.github
3+
node_modules
4+
dist
5+
coverage
6+
test-output
7+
*.tgz
8+
.codex
9+
.agents
10+
.kiro
11+
.vscode
12+
.idea
13+
.DS_Store

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- develop
9+
- "feature/**"
10+
pull_request:
11+
12+
jobs:
13+
quality:
14+
name: Build and Test (Node ${{ matrix.node-version }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
node-version: [18, 20]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: npm
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build
35+
run: npm run build
36+
37+
- name: Test
38+
run: npm test
39+
40+
- name: CLI help smoke test
41+
run: node dist/cli.js --help
42+
43+
- name: Package smoke test
44+
run: npm pack --dry-run

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:20-alpine AS builder
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm ci
7+
8+
COPY tsconfig.json ./
9+
COPY src ./src
10+
RUN npm run build
11+
12+
FROM node:20-alpine AS runtime
13+
14+
WORKDIR /app
15+
16+
COPY package*.json ./
17+
RUN npm ci --omit=dev && npm cache clean --force
18+
19+
COPY --from=builder /app/dist ./dist
20+
COPY README.md QUICK_START.md USAGE.md ./
21+
22+
ENTRYPOINT ["node", "dist/cli.js"]

0 commit comments

Comments
 (0)