-
Notifications
You must be signed in to change notification settings - Fork 40
59 lines (48 loc) · 1.48 KB
/
ci.yml
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
name: Jsonnet CI
defaults:
run:
shell: bash
on:
push:
branches: [ master ]
paths:
- templates/**
- .github/**
- assets/**
pull_request:
branches: [ master ]
paths:
- templates/**
- .github/**
- assets/**
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Get dependencies
run: make deps
- name: Run jsonnetfmt
run: make format
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Compile dashboards
run: make
- name: Run grafana container
run: sudo docker run -d -p 3000:3000 docker.io/grafana/grafana:9.4.3
- name: Wait for grafana
run: while [[ $(curl -s -o /dev/null -w '%{http_code}' http://localhost:3000/api/health) != "200" ]]; do sleep 1; done
- name: Import dashboards to grafana
run: >
for t in rendered/**/*.json; do
echo "Importing ${t}";
dashboard=$(cat ${t});
echo "{\"dashboard\": ${dashboard}, \"overwrite\": true}" |
curl -k -Ss -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -d@-
"http://admin:admin@localhost:3000/api/dashboards/db" -o /dev/null;
done