Merge pull request #122 from FYP-2024-IQMA/chat-evaluation #177
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: Run Backend CI | |
on: | |
push: | |
branches: | |
- develop | |
paths: | |
- "backend/**" | |
pull_request: | |
branches: | |
- develop | |
paths: | |
- "backend/**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository in Virtual Machine | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
working-directory: backend | |
run: | | |
npm install | |
- name: Run Tests | |
working-directory: backend | |
run: | | |
npm test | |
security: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository in Virtual Machine | |
uses: actions/checkout@v4 | |
- name: Build Backend Docker Image | |
working-directory: backend | |
run: | | |
docker build -t backend:latest . | |
- name: Build Chatbot Docker Image | |
working-directory: backend/src/chatbot | |
run: | | |
docker build -t chatbot:latest . | |
- name: Run Snyk to check Backend Docker image for vulnerabilities | |
uses: snyk/actions/docker@master | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
with: | |
image: backend:latest | |
- name: Run Snyk to check Chatbot Docker image for vulnerabilities | |
uses: snyk/actions/docker@master | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
with: | |
image: chatbot:latest |