Repository navigation
166 lines (137 loc) · 4.72 KB
/
Copy pathcontainer.yml
File metadata and controls
166 lines (137 loc) · 4.72 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
name: Publish release container
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
concurrency:
group: container-release-${{ github.ref }}
cancel-in-progress: false
jobs:
validate:
name: Validate release source
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Verify tag matches VERSION
shell: bash
run: |
version="$(cat VERSION)"
test "${GITHUB_REF_NAME}" = "v${version}" || {
echo "Tag ${GITHUB_REF_NAME} does not match VERSION=${version}"
exit 1
}
- name: Verify Compose release files stay in sync
run: cmp -s compose.yml docker-compose.yml
- name: Public docs sanity
shell: bash
run: |
version="$(cat VERSION)"
grep -q "raw.githubusercontent.com/M9RPH/vibewatch/v${version}/compose.yml" README.md
test -f docs/SCREENSHOTS.md
test -f docs/screenshots/dashboard.png
test -f docs/screenshots/containers.png
test -f docs/screenshots/hosts.png
test -f docs/screenshots/rollback.png
- name: Ensure SQLite CLI
shell: bash
timeout-minutes: 5
run: |
if command -v sqlite3 >/dev/null 2>&1; then
sqlite3 --version
exit 0
fi
sudo timeout 180s apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 update
sudo timeout 180s apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 install -y sqlite3
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Go tests
run: go test -count=1 ./...
- name: Go vet
run: go vet ./...
- name: Build controller
run: go build -trimpath -ldflags "-X main.version=$(cat VERSION)" ./cmd/server
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install frontend dependencies
working-directory: web
run: npm install --no-audit --no-fund
- name: Build frontend
working-directory: web
run: npm run build
- name: Docker image build smoke test
run: docker build --build-arg VIBEWATCH_VERSION="$(cat VERSION)" -t vibewatch-release-smoke:${{ github.sha }} .
docker-integration:
name: Docker integration tests
runs-on: ubuntu-latest
timeout-minutes: 20
needs: validate
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Docker integration smoke tests
run: bash ./scripts/test-integration.sh
- name: Ensure NetEm prerequisites
shell: bash
timeout-minutes: 5
run: |
if command -v tc >/dev/null 2>&1; then
tc -V
exit 0
fi
sudo timeout 180s apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 update
sudo timeout 180s apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 install -y iproute2
- name: NetEm ~50 ms RTT regression
run: sudo env VIBEWATCH_NETEM_LOSS=0% bash ./scripts/test-netem.sh
publish:
name: Publish GHCR multi-arch image
runs-on: ubuntu-latest
needs: [validate, docker-integration]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- id: app_version
name: Read release version
shell: bash
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/m9rph/vibewatch
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- name: Build and push multi-arch image
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VIBEWATCH_VERSION=${{ steps.app_version.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max