2022-06-27 21:28:21 -07:00
|
|
|
name: CI Pipeline for the Backend and Frontend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
env:
|
|
|
|
NODE_VERSION: 16.15.0
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
jobs:
|
2022-07-05 05:37:17 -07:00
|
|
|
backend:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
flavor: ['dev', 'prod']
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
|
|
|
|
name: Backend (${{ matrix.flavor }})
|
2022-06-27 21:28:21 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-07-05 04:46:13 -07:00
|
|
|
with:
|
2022-07-05 05:37:17 -07:00
|
|
|
path: ${{ matrix.flavor }}
|
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
- name: Install
|
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-05 04:42:04 -07:00
|
|
|
run: npm install
|
2022-07-05 05:37:17 -07:00
|
|
|
working-directory: ${{ matrix.flavor }}/backend
|
|
|
|
|
|
|
|
- name: Install (Prod dependencies only)
|
|
|
|
if: ${{ matrix.flavor == 'prod'}}
|
|
|
|
run: npm install --prod
|
|
|
|
working-directory: ${{ matrix.flavor }}/backend
|
|
|
|
|
2022-07-05 04:30:56 -07:00
|
|
|
- name: Lint
|
2022-07-05 05:37:17 -07:00
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-05 04:30:56 -07:00
|
|
|
run: npm run lint
|
2022-07-05 05:37:17 -07:00
|
|
|
working-directory: ${{ matrix.flavor }}/backend
|
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
# - name: Test
|
|
|
|
# run: npm run test
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
2022-07-05 05:37:17 -07:00
|
|
|
working-directory: ${{ matrix.flavor }}/backend
|
|
|
|
|
|
|
|
frontend:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
flavor: ['dev', 'prod']
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
|
|
|
|
name: Frontend (${{ matrix.flavor }})
|
2022-07-05 04:42:04 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-07-05 04:46:13 -07:00
|
|
|
with:
|
2022-07-05 05:37:17 -07:00
|
|
|
path: ${{ matrix.flavor }}
|
|
|
|
|
2022-07-05 04:42:04 -07:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
- name: Install (Prod dependencies only)
|
2022-07-06 23:38:05 +02:00
|
|
|
run: npm install --prod
|
2022-07-05 05:37:17 -07:00
|
|
|
if: ${{ matrix.flavor == 'prod'}}
|
|
|
|
working-directory: ${{ matrix.flavor }}/frontend
|
|
|
|
|
|
|
|
- name: Install
|
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-05 04:48:44 -07:00
|
|
|
run: npm install
|
2022-07-05 05:37:17 -07:00
|
|
|
working-directory: ${{ matrix.flavor }}/frontend
|
|
|
|
|
2022-07-06 23:38:05 +02:00
|
|
|
- name: Lint
|
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-05 04:42:04 -07:00
|
|
|
run: npm run lint
|
2022-07-05 05:37:17 -07:00
|
|
|
working-directory: ${{ matrix.flavor }}/frontend
|
|
|
|
|
2022-07-05 04:42:04 -07:00
|
|
|
# - name: Test
|
|
|
|
# run: npm run test
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-05 04:42:04 -07:00
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
2022-07-05 05:37:17 -07:00
|
|
|
working-directory: ${{ matrix.flavor }}/frontend
|