Skip to content

Commit

Permalink
Using Docker Compose instead for Github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsong86 committed Aug 21, 2024
1 parent 9ed9080 commit c6c0327
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,13 @@ jobs:
build:
runs-on: ubuntu-latest

services:
redis:
image: redis:7.4.0
ports:
- 6379:6379

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Wait for Redis to be ready
run: |
for i in {1..30}; do
if nc -zv redis 6379; then
echo "Redis is ready!"
break
fi
echo "Waiting for Redis to be ready..."
sleep 3
done
- name: Build and test backend Docker image
- name: Build and run with Docker Compose
run: |
docker build --target backend -t backend -f Dockerfile .
docker build --target tests -t tests -f Dockerfile .
docker run --rm tests
- name: Build frontend Docker image
run: docker build --target frontend -t frontend -f Dockerfile .

- name: Run frontend build in Docker
run: docker run --rm frontend npm run build
docker-compose up --build --abort-on-container-exit --exit-code-from tests

0 comments on commit c6c0327

Please sign in to comment.