Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Pool Appointments API CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
test-ci:
name: Test CI
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout code
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: Run linting
# run: npm run lint

- name: Run tests
run: npm test

- name: Run build
run: npm run build

deploy-development:
needs: test-ci
name: Deploy to Development
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
concurrency: deploy-development
environment: development

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

# - name: Run linting
# run: npm run lint

- name: Run tests
run: npm test

- name: Build application
run: npm run build

- name: Deploy to development environment
run: echo "✅ Deployed to development environment"

deploy-production:
needs: test-ci
name: Deploy to Production
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency: deploy-production
environment: production

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

# - name: Run linting
# run: npm run lint

- name: Run tests
run: npm test

- name: Build application
run: npm run build

- name: Deploy to production environment
run: echo "✅ Deployed to production environment"