Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Allison67 committed Dec 6, 2023
1 parent fb74696 commit 6672828
Showing 1 changed file with 17 additions and 39 deletions.
56 changes: 17 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,32 @@
name: CI
name: CI for Front-end and Back-end

on:
push:
branches:
- cicd
pull_request:
branches:
- cicd
on: [push]

jobs:
build-and-deploy:
test-backend:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js (for front-end)
uses: actions/setup-node@v2
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: "18"

- name: "Create Back-end .env File"
run: |
pwd
hostname
cd back-end
touch .env
echo FRONT_END_DOMAIN=${{ secrets.FRONT_END_DOMAIN }} >> .env
echo REACT_APP_BACKEND=${{ secrets.REACT_APP_BACKEND }} >> .env
echo JWT_SECRET=${{ secrets.JWT_SECRET }} >> .env
echo JWT_EXP_DAYS=${{ secrets.JWT_EXP_DAYS }} >> .env
echo MONGODB_URI=${{ secrets.MONGODB_URI }} >> .env
echo AVATAR_GENERATOR=${{ secrets.AVATAR_GENERATOR }} >> .env
node-version: "14.x"

- name: Install front-end dependencies
- name: Build front-end
run: |
cd front-end
npm install
npm run build
- name: Install back-end dependencies
- name: Install dependencies
run: |
cd back-end
npm install
# - name: Run back-end tests
# run: |
# cd back-end
# npm test
npm ci
# - name: Build and run Docker containers
# run: docker-compose up --build
- name: Run back-end tests
env:
MONGO_ATLAS_URI: ${{ secrets.MONGODB_URI }}
run: |
cd back-end
npm test

0 comments on commit 6672828

Please sign in to comment.