-
-
Notifications
You must be signed in to change notification settings - Fork 33
174 lines (151 loc) · 5.52 KB
/
docker-image.yml
File metadata and controls
174 lines (151 loc) · 5.52 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Docker Image CI
on:
push:
branches: ["main"]
tags:
- "v*"
pull_request:
branches: ["main"]
workflow_dispatch:
schedule:
- cron: '0 0,12 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
permissions:
id-token: write
packages: write
contents: read
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Verify essential data files
run: |
echo "Checking for essential data files..."
if [ ! -f "data/unified.json" ]; then
echo "⚠️ WARNING: data/unified.json not found in repository"
echo "Collections feature will not work unless this file is committed to git"
echo "Consider using Git LFS for large files: git lfs track 'data/unified.json'"
else
echo "✅ data/unified.json found"
fi
if [ ! -f "data/franchises.json" ]; then
echo "⚠️ WARNING: data/franchises.json not found"
else
echo "✅ data/franchises.json found"
fi
continue-on-error: true
- name: Test build and verify routes
run: |
echo "Running test build to verify routes..."
npm run build
echo "Checking build output for logs routes..."
if [ -d ".output/server/chunks/routes/api/logs" ]; then
echo "✅ logs/ directory found in build"
ls -la .output/server/chunks/routes/api/logs/
else
echo "❌ CRITICAL: logs/ directory NOT in build output!"
echo "Available API routes:"
ls -la .output/server/chunks/routes/api/ | head -30
exit 1
fi
# Verify all required route files
REQUIRED=("entries.get.mjs" "errors.get.mjs" "failures.get.mjs" "success.get.mjs" "critical.get.mjs")
MISSING=0
for route in "${REQUIRED[@]}"; do
if [ ! -f ".output/server/chunks/routes/api/logs/$route" ]; then
echo "❌ Missing route: logs/$route"
MISSING=1
else
echo "✅ Found route: logs/$route"
fi
done
if [ "$MISSING" -eq 1 ]; then
echo "❌ Build verification failed - missing required routes"
exit 1
fi
# Verify logs-statistics route
if [ ! -f ".output/server/chunks/routes/api/logs-statistics.get.mjs" ]; then
echo "❌ Missing route: logs-statistics.get.mjs"
exit 1
else
echo "✅ Found route: logs-statistics.get.mjs"
fi
echo "✅ All routes verified successfully"
continue-on-error: false
- name: Run linting
run: npm run lint || true
continue-on-error: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true
driver-opts: |
image=moby/buildkit:latest
- name: Docker metadata for seerrbridge
id: meta_seerrbridge
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/seerrbridge
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix={{branch}}-
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Verify server API routes before build
run: |
echo "Checking server API structure..."
if [ ! -d "server/api/logs" ]; then
echo "❌ ERROR: server/api/logs directory not found!"
exit 1
fi
echo "✅ server/api/logs directory exists"
ls -la server/api/logs/
if [ -f "server/api/logs.get.ts" ]; then
echo "❌ ERROR: server/api/logs.get.ts exists! This conflicts with logs/ directory."
echo "It should be renamed to logs-statistics.get.ts"
exit 1
fi
if [ ! -f "server/api/logs-statistics.get.ts" ]; then
echo "❌ ERROR: server/api/logs-statistics.get.ts not found!"
exit 1
fi
echo "✅ All route files verified"
- name: Build and push unified seerrbridge
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.unified
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_seerrbridge.outputs.tags }}
labels: ${{ steps.meta_seerrbridge.outputs.labels }}
provenance: mode=max
sbom: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true