portainer added for monitoring #2 #5
This file contains hidden or 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 for Ming Distributed Network | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v2 | |
- name: Install Docker Compose | |
run: | | |
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
docker-compose --version | |
- name: Build Docker Compose services | |
run: docker-compose up --build -d | |
- name: Run container health check | |
run: | | |
sleep 10 # Wait for containers to initialize | |
curl -f http://localhost:3001 || exit 1 | |
curl -f http://localhost:3002 || exit 1 | |
curl -f http://localhost:3003 || exit 1 | |
- name: Run tests (if you have tests set up) | |
run: | | |
curl http://localhost:3001 | grep "Hello from Node 1" | |
curl http://localhost:3002 | grep "Hello from Node 2" | |
curl http://localhost:3003 | grep "Hello from Node 3" | |
- name: Tear down Docker Compose | |
run: docker-compose down |