generated from agiledev-students-fall2023/generic-project-repository
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
39 deletions.
There are no files selected for viewing
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
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 |