cd #10
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: | |
- cicd | |
pull_request: | |
branches: | |
- cicd | |
jobs: | |
build-and-deploy: | |
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 | |
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 | |
- name: Install front-end dependencies | |
run: | | |
cd front-end | |
npm install | |
- name: Install back-end dependencies | |
run: | | |
cd back-end | |
npm install | |
# - name: Run back-end tests | |
# run: | | |
# cd back-end | |
# npm test | |
# - name: Build and run Docker containers | |
# run: docker-compose up --build |