-
Notifications
You must be signed in to change notification settings - Fork 5
111 lines (96 loc) · 2.89 KB
/
statsbit.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
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
name: Statsbit
on:
push:
branches: [ master, development ]
paths:
- '.github/**'
- 'backend/**'
- 'grafana/**'
defaults:
run:
working-directory: backend
jobs:
backend-test:
runs-on: ubuntu-latest
container: clojure:openjdk-11-tools-deps-1.10.1.739
services:
postgres:
image: timescale/timescaledb:2.1.0-pg13
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
STATSBIT_BACKEND_DB_NAME: postgres
STATSBIT_BACKEND_DB_HOST: postgres
STATSBIT_BACKEND_DB_PORT: 5432
STATSBIT_BACKEND_DB_USER: postgres
STATSBIT_BACKEND_DB_PASSWORD: password
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: /root/.m2
key: test-${{ hashFiles('backend/deps.edn') }}
restore-keys: test-
- run: clojure -M:dev -m ru.bia-tech.statsbit.migration test
- run: clojure -M:dev:run-tests
backend-build:
needs: backend-test
runs-on: ubuntu-latest
container: clojure:openjdk-11-tools-deps-1.10.1.739
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: /root/.m2
key: build-${{ hashFiles('backend/deps.edn') }}
restore-keys: build-
- run: clojure -X:prod:depstar
- uses: actions/upload-artifact@v2
with:
name: app.jar
path: backend/build/app.jar
backend-docker:
needs: backend-build
runs-on: ubuntu-latest
steps:
- uses: rlespinasse/[email protected]
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: app.jar
path: backend/build
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: ./backend/build
file: ./backend/build/Dockerfile
push: true
tags: biatechru/statsbit:${{ env.GITHUB_REF_SLUG }}-backend-${{ github.run_number }}-${{ env.GITHUB_SHA_SHORT }}
grafana-docker:
needs: backend-build
runs-on: ubuntu-latest
steps:
- uses: rlespinasse/[email protected]
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: ./grafana
file: ./grafana/Dockerfile
push: true
tags: biatechru/statsbit:${{ env.GITHUB_REF_SLUG }}-grafana-${{ github.run_number }}-${{ env.GITHUB_SHA_SHORT }}