Merge pull request #122 from nicolelim02/chore/build #158
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 | |
on: | |
push: | |
branches: | |
- "*" | |
env: | |
NODE_VERSION: 20 | |
permissions: | |
contents: read | |
jobs: | |
frontend-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setting node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
working-directory: frontend | |
run: npm install | |
- name: Linting | |
working-directory: frontend | |
run: npm run lint | |
- name: Test | |
run: docker compose -f docker-compose-test.yml run --rm test-frontend | |
- name: Build | |
run: docker compose -f docker-compose-prod.yml build frontend | |
backend-ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: | |
[ | |
question-service, | |
user-service, | |
matching-service, | |
collab-service, | |
code-execution-service, | |
communication-service, | |
qn-history-service, | |
] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setting node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
working-directory: backend/${{ matrix.service }} | |
run: npm install | |
- name: Linting | |
working-directory: backend/${{ matrix.service }} | |
run: npm run lint | |
- name: Test | |
env: | |
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }} | |
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }} | |
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }} | |
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
ONE_COMPILER_KEY: ${{ secrets.ONE_COMPILER_KEY }} | |
run: docker compose -f docker-compose-test.yml run --rm test-${{ matrix.service }} | |
- name: Build | |
run: docker compose -f docker-compose-prod.yml build ${{ matrix.service }} |