-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
59 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |