Skip to content

Commit

Permalink
ci: Check the container's health after running the image
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetumit committed Nov 5, 2023
1 parent 93e167a commit d510efd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
branches:
- "main"
paths-ignore:
- '**.md'
- "**.md"
pull_request:
paths-ignore:
- '**.md'
- "**.md"

jobs:
Build:
Expand Down Expand Up @@ -39,7 +39,14 @@ jobs:
- name: Build Image
run: make docker-build
- name: Run Image
run: make docker-run
run: |
docker run --name dexus -d -p 8080:8080 --rm dexus:latest
sleep 5
if [ ! "$(curl -fs localhost:8080/health)" ]; then
printf 'err: container is not running properly' >&2
exit 1
fi
docker stop dexus
- name: Deploy Image
run: echo 'TODO'

Expand All @@ -49,7 +56,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down

0 comments on commit d510efd

Please sign in to comment.