fix: ci #4
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: Docker Check | |
| on: | |
| pull_request: | |
| issue_comment: | |
| types: | |
| - created | |
| workflow_dispatch: | |
| jobs: | |
| docker-check: | |
| name: Docker Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.issue.pull_request.head.sha }} | |
| repository: ${{ github.event.repository.full_name }} | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up Docker Compose | |
| uses: docker/setup-compose-action@v1 | |
| - name: Run docker compose | |
| working-directory: ./template/nestJs | |
| run: docker compose up -d | |
| - name: Wait Service | |
| working-directory: ./template/nestJs | |
| run: | | |
| timeout 60 bash -c ' | |
| until [[ "$(docker compose -f docker-compose.yaml ps --services --filter "status=running" | wc -l)" -ge 1 ]]; do | |
| sleep 2 | |
| done | |
| ' | |
| - name: Send HealthCheck Request | |
| run: curl -k http://localhost:3000/healthCheck | |
| - name: Check service logs | |
| if: failure() | |
| working-directory: ./template/nestJs | |
| run: docker compose -f docker-compose.yaml logs back | |
| - name: Shutdown Service | |
| working-directory: ./template/nestJs | |
| run: docker compose -f docker-compose.yaml down |