diff --git a/.github/workflows/docker_compose.yml b/.github/workflows/docker_compose.yml index ff0d703..8461f3e 100644 --- a/.github/workflows/docker_compose.yml +++ b/.github/workflows/docker_compose.yml @@ -12,9 +12,20 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + - name: Create .env + run: cp .env.example .env + - name: Create public.pem + run: cp keys/public.pem.example keys/public.pem + - name: Create private.pem + run: cp keys/private.pem.example keys/private.pem + - name: Create tests .env + run: cp tests/.env.test.example tests/.env.test - name: Build docker images - run: docker-compose build -d - - name: Enter node app container - run: docker exec -it app bash + run: docker-compose build + - name: Run docker images + run: docker-compose up -d - name: Run tests - run: npm test + run: docker exec -t app npm test + - name: Clean up + if: success() || failure() + run: docker-compose down --rmi all -v --remove-orphans \ No newline at end of file diff --git a/README.md b/README.md index c390194..17a6508 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Node.js Backend Architecture Typescript Project ### A complete project to build a blogging platform like Medium, and FreeCodeCamp +[![Docker Compose CI](https://github.com/janishar/nodejs-backend-architecture-typescript/actions/workflows/docker_compose.yml/badge.svg)](https://github.com/janishar/nodejs-backend-architecture-typescript/actions/workflows/docker_compose.yml) + Note: This is the **latest (version 2)** of the project. If you are using **version 1** then checkout the branch [**version-1**](https://github.com/janishar/nodejs-backend-architecture-typescript/tree/version-1)