Skip to content

Add GitHub Actions workflow documentation #3

Add GitHub Actions workflow documentation

Add GitHub Actions workflow documentation #3

Workflow file for this run

name: CI
on:
push:
branches: [ main, feature/** ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: app/package-lock.json
- name: Install dependencies
working-directory: ./app
run: npm ci
- name: Build backend
working-directory: ./app
run: npm run build --workspace=backend
- name: Build frontend
working-directory: ./app
run: npm run build --workspace=frontend
- name: Verify build artifacts
working-directory: ./app
run: |
echo "Checking backend build artifacts..."
test -d backend/dist || (echo "Backend dist directory not found" && exit 1)
test -f backend/dist/server.js || (echo "Backend server.js not found" && exit 1)
test -f backend/dist/discount-rules.js || (echo "Backend discount-rules.js not found" && exit 1)
echo "Checking frontend build artifacts..."
test -d frontend/dist || (echo "Frontend dist directory not found" && exit 1)
test -f frontend/dist/index.html || (echo "Frontend index.html not found" && exit 1)
echo "✅ All build artifacts verified successfully"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-node-${{ matrix.node-version }}
path: |
app/backend/dist/
app/frontend/dist/
retention-days: 7