Merge pull request #113 from GDSC-PKNU-21-22/fix/#112 #159
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 Workflow | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
docker: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Create .env file | |
run: | | |
echo "DATABASE_NAME=${{ secrets.DATABASE_NAME }}" >> .env | |
echo "DATABASE_PORT=${{ secrets.DATABASE_PORT }}" >> .env | |
echo "DATABASE_ROOT_PASSWORD=${{ secrets.DATABASE_ROOT_PASSWORD }}" >> .env | |
echo "DATABASE_USER=${{ secrets.DATABASE_USER }}" >> .env | |
echo "DATABASE_USER_PASSWORD=${{ secrets.DATABASE_USER_PASSWORD }}" >> .env | |
echo "SERVER_PORT=${{ secrets.SERVER_PORT }}" >> .env | |
- name: Start docker container | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install Yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: sudo yarn install | |
- name: Run tests | |
run: yarn test | |
- name: Stop containers | |
if: always() | |
run: docker-compose -f "docker-compose.yml" down |