Add CI/CD configuration and additional utility scripts: build.yml
This commit is contained in:
parent
bb4e9e378b
commit
1fa87fe2ae
1 changed files with 54 additions and 0 deletions
54
.github/workflows/build.yml
vendored
Normal file
54
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x, 20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build TypeScript
|
||||
run: npm run build
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint --if-present
|
||||
|
||||
- name: Run tests
|
||||
run: npm test --if-present
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t ross-ultrix-mcp:latest .
|
||||
|
||||
- name: Test Docker image
|
||||
run: |
|
||||
docker run --rm ross-ultrix-mcp:latest node dist/health-check.js --simple
|
||||
Loading…
Reference in a new issue