-
-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (73 loc) · 2.55 KB
/
build.yml
File metadata and controls
81 lines (73 loc) · 2.55 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build and smoke test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v6
with:
context: .
# Load into the local Docker daemon for the smoke test.
# On main pushes we also push to GHCR (see next step).
load: true
platforms: linux/amd64
tags: sentry-orbital:local
cache-from: type=registry,ref=ghcr.io/getsentry/sentry-orbital:nightly
cache-to: type=inline
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=https://github.com/getsentry/sentry-orbital
- name: Smoke test
run: |
docker run --rm -d \
--name orbital-smoke \
-p 7000:7000 \
sentry-orbital:local
# Wait for the container to be ready
for i in $(seq 1 10); do
if curl -sf http://localhost:7000/healthz; then
break
fi
echo "Waiting... ($i)"
sleep 1
done
# /healthz must return 200 with body "ok"
HEALTH=$(curl -sf http://localhost:7000/healthz)
[ "$HEALTH" = "ok" ] || (echo "healthz returned: $HEALTH" && exit 1)
# / must return 200 and contain the globe canvas
curl -sf http://localhost:7000/ | grep -q 'orbital' || (echo "index page missing expected content" && exit 1)
docker stop orbital-smoke
- name: Push to GHCR
if: github.event_name == 'push'
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64
tags: |
ghcr.io/getsentry/sentry-orbital:nightly
ghcr.io/getsentry/sentry-orbital:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/getsentry/sentry-orbital:nightly
cache-to: type=inline
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=https://github.com/getsentry/sentry-orbital