Skip to content

Commit

Permalink
Merge pull request #14 from CS3219-AY2425S1/AidenLYT-patch-1
Browse files Browse the repository at this point in the history
Create cicd.yml
  • Loading branch information
AidenLYT authored Sep 18, 2024
2 parents c69425e + bce4a6f commit 6bf7fd2
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD Pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./peer-prep-fe/
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './peer-prep-fe/package-lock.json'
- name: Install dependencies
run: npm install
- name: Build frontend
run: npm run build --if-present
- name: Run tests
run: npm test -- --watch=false --browsers=ChromeHeadless

build-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23
- name: Build backend
run: |
cd peer-prep-be
go build -o ./src ./src
# - name: Test backend
# run: |
# cd peer-prep-be
# go test -v ./main
# deploy:
# needs: [build-frontend, build-backend]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Deploy Application
# run: ./deploy.sh

0 comments on commit 6bf7fd2

Please sign in to comment.