fix: ci #3
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: | |
| issue_comment: | |
| types: | |
| - created | |
| workflow_dispatch: | |
| jobs: | |
| docker-check: | |
| name: Docker Check | |
| if: | | |
| github.event.issue.pull_request && | |
| contains(github.event.comment.body, 'docker check plz') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build docker image | |
| working-directory: ./template/nestJs | |
| run: docker-compose -f docker-compose.yaml build | |
| - name: Run docker compose | |
| working-directory: ./template/nestJs | |
| run: docker-compose -f docker-compose.yaml 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 |