Update more deploy scripts #14
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: Test service | |
on: | |
push: | |
branches-ignore: | |
- main | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.SHARED_PAT }} | |
submodules: recursive | |
- name: Build and start services | |
run: | | |
docker compose -f docker-compose.test.yml up -d database | |
sleep 10 # Adjust sleep time as needed to allow services to start | |
- name: Wait for database to be ready | |
run: | | |
until docker compose -f docker-compose.test.yml exec -T database pg_isready -U postgres; do | |
>&2 echo "Postgres is unavailable - sleeping" | |
sleep 1 | |
done | |
- name: Start app service | |
run: docker compose -f docker-compose.test.yml up --force-recreate --build --exit-code-from app app | |
- name: Clean up | |
if: always() | |
run: docker compose -f docker-compose.test.yml down |