chore: add cicd docker compose #3
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: Docker Compose Pipeline | |
on: | |
push: | |
branches: | |
- main | |
- staging | |
pull_request: | |
branches: | |
- main | |
- staging | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
docker: | |
image: docker:19.03.12 | |
options: --privileged | |
ports: | |
- 8080:8080 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Compose | |
run: sudo apt-get update && sudo apt-get install docker-compose -y | |
- name: Build and Run Services | |
run: | | |
cd ./apps | |
docker-compose up --build -d | |
- name: Wait for services to be ready | |
run: sleep 10 # this is the estimated service startup time | |
- name: Run Tests | |
run: | | |
curl --fail http://localhost:3000 # Adjust based on the app | |
# You can add more tests here |