forked from opentiny/tiny-pro
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.37 KB
/
Copy pathdocker-check.yaml
File metadata and controls
48 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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.yml ps --services --filter "status=running" | wc -l)" -ge 1 ]]; do
sleep 2
done
'
- name: Send HealthCheck Request
run: curl -k --retry 20 --retry-delay 5 --retry-all-errors -f http://localhost:3000/healthCheck
- name: Check service logs
if: failure()
working-directory: ./template/nestJs
run: docker compose -f docker-compose.yml logs back
- name: Shutdown Service
working-directory: ./template/nestJs
run: docker compose -f docker-compose.yml down