ci(root): Add Dockerfile and docker-compose #10
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: Deploy Checks | |
on: | |
pull_request: | |
branches: [ dev ] | |
jobs: | |
deploy_preview: | |
name: Deploy Checks | |
runs-on: ubuntu-latest | |
permissions: | |
deployments: write | |
contents: read | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Install jq | |
run: sudo apt-get update && sudo apt-get install -y jq | |
- name: Build Docker Compose services | |
run: docker-compose build | |
- name: Start Docker Compose services | |
run: docker-compose up -d | |
- name: Check Docker Compose services are running | |
run: | | |
for service in $(docker-compose ps --services); do | |
if [ "$(docker inspect -f '{{.State.Status}}' $service)" != "running" ]; then | |
echo "Service $service is not running" | |
exit 1 | |
fi | |
done | |
- name: Shutdown Docker Compose services | |
run: docker-compose down |