ci: add CI pipeline and port config
This commit is contained in:
@@ -0,0 +1,52 @@
|
|||||||
|
name: CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master, main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate-and-build:
|
||||||
|
name: Build & Validate
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install Frontend Dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run TypeScript & Lint Checks
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Build Frontend Application
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Validate Backend
|
||||||
|
run: |
|
||||||
|
cd backend
|
||||||
|
npm ci
|
||||||
|
node --check server.js database.js mail.js
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
name: Docker Build Validation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: validate-and-build
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Docker Compose Stack
|
||||||
|
run: docker compose build
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
name: CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master, main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate-and-build:
|
||||||
|
name: Build & Validate
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install Frontend Dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run TypeScript & Lint Checks
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Build Frontend Application
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Validate Backend
|
||||||
|
run: |
|
||||||
|
cd backend
|
||||||
|
npm ci
|
||||||
|
node --check server.js database.js mail.js
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
name: Docker Build Validation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: validate-and-build
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Docker Compose Stack
|
||||||
|
run: docker compose build
|
||||||
@@ -6,6 +6,8 @@ services:
|
|||||||
target: production
|
target: production
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
|
ports:
|
||||||
|
- "3000:80"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
Reference in New Issue
Block a user