forked from RaminNietzsche/CVE-Radar
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 1.65 KB
/
Copy pathci-docker-smoke.yml
File metadata and controls
63 lines (55 loc) · 1.65 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Category: CI | Docker image build smoke test — no push, GHA cache.
name: CI / Docker smoke
on:
pull_request:
branches: [main]
paths: &docker-paths
- "Dockerfile"
- "docker-compose*.yml"
- "docker-compose*.yaml"
- ".dockerignore"
- "server/**"
- "package.json"
- "package-lock.json"
- ".github/workflows/ci-docker-smoke.yml"
push:
branches: [main]
paths: *docker-paths
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-docker-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker:
name: Docker image (build only)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
- name: Build image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
push: false
load: true
tags: cve-radar:ci
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test (health)
run: |
docker run -d --name cve-radar-ci-smoke -p 13002:3001 cve-radar:ci
for i in $(seq 1 15); do
if curl -fsS http://127.0.0.1:13002/api/health; then
docker rm -f cve-radar-ci-smoke
exit 0
fi
sleep 2
done
docker logs cve-radar-ci-smoke || true
docker rm -f cve-radar-ci-smoke
exit 1