Merge pull request #342 from TheSecretOrganization/fix-send-button #407
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
name: Deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
docker-compose: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create .env file | |
run: cp .env.template .env | |
- name: Build containers | |
run: docker compose build | |
- name: Run django tests | |
run: docker compose run django python manage.py test | |
- name: Shutdown containers | |
run: docker compose down --volumes | |
- name: Run containers | |
run: docker compose up -d | |
- name: Wait for services to initialize | |
run: sleep 5 | |
- name: Perform 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 |