Skip to content

Commit

Permalink
Add DB to Docker E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
textbook committed Jan 30, 2024
1 parent f4d5071 commit 5321b31
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ jobs:
DATABASE_URL: postgres://testdb:keepitsecret@localhost:5432/testdb
docker:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: keepitsecret
POSTGRES_USER: testdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: textbook/take-action@nodejs
with:
Expand All @@ -51,12 +64,19 @@ jobs:
load: true
push: false
tags: textbook/starter-kit:v2
- id: env-file
run: |
echo "file=$ENV_FILE" >> $GITHUB_OUTPUTS
echo 'LOG_LEVEL=debug' >> $ENV_FILE
echo 'NODE_ENV=docker' >> $ENV_FILE
echo 'DATABASE_URL=postgres://testdb:keepitsecret@localhost:5432/testdb' >> $ENV_FILE
env:
ENV_FILE: docker.env
- id: docker-run
run: |
echo "id=$(docker run \
--detach \
--env LOG_LEVEL=debug \
--env NODE_ENV=docker \
--env-file ${{ steps.env-file.outputs.file }} \
--init \
--publish 4321:80 \
textbook/starter-kit:v2)" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 5321b31

Please sign in to comment.