Skip to content

Commit

Permalink
Fix github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gf-rog committed Nov 17, 2023
1 parent c58a286 commit fc45890
Showing 1 changed file with 59 additions and 8 deletions.
67 changes: 59 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,66 @@ jobs:
build:
runs-on: ubuntu-latest

services:
db:
image: neo4j:5.12.0
env_file:
- db/credentials.env
ports:
- 7474:7474
- 7687:7687
volumes:
- ./db/data:/data
- ./db/conf:/conf
frontend:
build: ./frontend
ports:
- 5173:80
backend:
build: ./backend
ports:
- 5000:5000
depends_on:
- db
command: sh -c "/wait && npm run prod"
environment:
- NEO4J_URI=neo4j://db:7687
- WAIT_HOSTS=db:7474
- WAIT_BEFORE_HOSTS=15
- WAIT_AFTER_HOSTS=3

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v3
# - uses: isbang/[email protected]
# with:
# compose-file: "compose.yml"
# services: |
# db
# frontend
# backend

- name: Create .env file
run: touch db/credentials.env
# - name: Create .env file
# run: touch db/credentials.env

# - name: Add login passes to env file
# run: echo "NEO4J_AUTH=neo4j/admin123" >> db/credentials.env

# - name: Run Docker compose
# run: docker-compose up -d

- name: List containers
run: sleep 2; docker ps

- name: Wait for containers to start
run: |
sleep 15
docker run \
--rm \
--network mercury-project_default \
alpine/curl -o /dev/null --retry 3 --retry-connrefused backend:5000
- name: Add login passes to env file
run: echo "NEO4J_AUTH=neo4j/admin" >> db/credentials.env
- name: Test the backend
run: cd backend; npm i && npm run test run

- name: Compose the Docker-compose file
run: docker-compose up
- name: Shut down Docker compose
run: cd ..; docker-compose down

0 comments on commit fc45890

Please sign in to comment.