Skip to content

Commit

Permalink
created workflow to check if containers are working
Browse files Browse the repository at this point in the history
  • Loading branch information
Neffi42 committed Aug 6, 2024
1 parent f8cfba4 commit 725cb0f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deployment-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deployment Check
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
docker-compose:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SECRET_KEY: "foo"
DJANGO_SUPERUSER_USERNAME: "bar"
DJANGO_SUPERUSER_EMAIL: "[email protected]"
DJANGO_SUPERUSER_PASSWORD: "foobar"
POSTGRES_DB: "foodb"
POSTGRES_USER: "bar"
POSTGRES_PASSWORD: "foobar"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build and up
run: docker compose up --build
- name: Health-checks
run: |
services=$(docker-compose ps --services)
for service in $services; do
status=$(docker inspect -f '{{.State.Health.Status}}' $service)
if [ "$status" != "healthy" ]; then
echo "$service is not healthy"
exit 1
fi
done

0 comments on commit 725cb0f

Please sign in to comment.