Skip to content

Commit db3895e

Browse files
ruggi99soedirgo
authored andcommitted
Add Github Action to build, run and check health
1 parent 709d552 commit db3895e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,40 @@ jobs:
3232
- uses: actionsx/prettier@v2
3333
with:
3434
args: --check "{src,test}/**/*.ts"
35+
36+
docker:
37+
name: Build with docker
38+
runs-on: ubuntu-20.04
39+
steps:
40+
- uses: actions/checkout@v3
41+
name: Checkout Repo
42+
43+
- uses: docker/setup-buildx-action@v2
44+
name: Set up Docker Buildx
45+
46+
- uses: docker/build-push-action@v3
47+
with:
48+
push: false
49+
tags: pg-meta:test
50+
load: true
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
53+
54+
- name: Check Health status
55+
run: |
56+
docker run -d --name pg-meta-test pg-meta:test
57+
state=$(docker inspect -f '{{ .State.Health.Status}}' pg-meta-test)
58+
if [ $state != "starting" ]; then
59+
exit 1
60+
fi
61+
sleep 10
62+
state=$(docker inspect -f '{{ .State.Health.Status}}' pg-meta-test)
63+
docker stop pg-meta-test
64+
if [ $state == "healthy" ]; then
65+
exit 0
66+
else
67+
exit 1
68+
fi
69+
70+
71+

0 commit comments

Comments
 (0)