Add CI on project with github actions #1
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Configurar Docker Compose | |
run: docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d | |
- name: Esperar pelos serviços ficarem disponíveis | |
run: docker-compose -f docker-compose.yml -f docker-compose.override.yml exec api01 sh -c "while ! nc -z database 3306; do sleep 1; done" && docker-compose -f docker-compose.yml -f docker-compose.override.yml exec api01 sh -c "while ! nc -z minio 9000; do sleep 1; done" | |
- name: Parar e remover contêineres Docker Compose | |
run: docker-compose -f docker-compose.yml -f docker-compose.override.yml down |