Update README of public repo #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
checks: write | |
jobs: | |
build-and-test: | |
name: Run Quality Control | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Filter | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
server: | |
- 'server/**' | |
client: | |
- 'client/**' | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
# Server | |
- name: Install Dependencies (server) | |
if: steps.filter.outputs.server == 'true' | |
working-directory: server | |
run: npm ci | |
- name: Run Quality Assurance (server) | |
if: steps.filter.outputs.server == 'true' | |
working-directory: server | |
run: NODE_ENV=test npm run qc | |
# TODO finish implementation | |
# - name: Coverage Report (server) | |
# if: steps.filter.outputs.server == 'true' | |
# uses: ArtiomTr/jest-coverage-report-action@v2 | |
# with: | |
# working-directory: server | |
# coverage-file: ./coverage/coverage-final.json | |
# base-coverage-file: ./coverage/coverage-final.json | |
# skip-step: all | |
# Client | |
- name: Install Dependencies (client) | |
if: steps.filter.outputs.client == 'true' | |
working-directory: client | |
run: npm ci | |
- name: Run Quality Assurance (client) | |
if: steps.filter.outputs.client == 'true' | |
working-directory: client | |
run: NODE_ENV=test npm run qc | |
# TODO finish implementation | |
# - name: Coverage Report (client) | |
# if: steps.filter.outputs.client == 'true' | |
# uses: ArtiomTr/jest-coverage-report-action@v2 | |
# with: | |
# working-directory: client | |
# coverage-file: ./coverage/coverage-final.json | |
# base-coverage-file: ./coverage/coverage-final.json | |
# skip-step: all | |
docker-deploy: | |
name: Build and Deploy to Docker Hub | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Filter | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
server: | |
- 'server/**' | |
client: | |
- 'client/**' | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and Push Server Docker Image | |
if: steps.filter.outputs.server == 'true' | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./server | |
file: ./server/Dockerfile | |
push: true | |
tags: middlewaymonk/offering-bowl-server:latest | |
# TODO upload to S3 instead, not as an image | |
# - name: Build and Push Client Docker Image | |
# if: steps.filter.outputs.client == 'true' | |
# uses: docker/build-push-action@v6 | |
# with: | |
# context: ./client | |
# file: ./client/Dockerfile | |
# push: true | |
# tags: middlewaymonk/offering-bowl-client:latest |