HRIS-361 [Task] Setup Nest.js under api_v2 folder #1573
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: Prebuild check and build | |
on: | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
build-frontend: | |
name: Build frontend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install modules | |
run: cd client && npm ci | |
- name: Run ESLint and Prettier | |
run: cd client && npm run check-format && npm run check-lint | |
- name: Build NextJS project | |
run: cd client && npm run build | |
build-backend: | |
name: Build Backend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v2 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "6.0.x" | |
- name: Run dotnet format | |
run: cd api && dotnet format --verify-no-changes | |
- name: Build dotnet project | |
run: cd api && dotnet build | |
build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create backend env file | |
run: cp .env.api.example .env.api | |
- name: Create frontend env file | |
run: cp .env.client.example .env.client | |
- name: Create db env file | |
run: cp .env.db.example .env.db | |
- name: Build the Docker image | |
run: docker compose build |