File tree 4 files changed +77
-4
lines changed
4 files changed +77
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Build Image
2
+
3
+ on :
4
+ push :
5
+ branches : [ main ]
6
+ paths :
7
+ - ' build-image/Dockerfile'
8
+ - ' .github/workflows/build-image.yaml'
9
+ pull_request :
10
+ branches : [ main ]
11
+ paths :
12
+ - ' build-image/Dockerfile'
13
+ - ' .github/workflows/build-image.yaml'
14
+
15
+ jobs :
16
+ build :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+ name : Checkout
21
+
22
+ - name : Build & save image
23
+ run : make build-image save-build-image
24
+
25
+ - name : Upload Docker Images Artifact
26
+ uses : actions/upload-artifact@v4
27
+ with :
28
+ name : build-image
29
+ path : ./build-image.tar
30
+ if-no-files-found : error
31
+
32
+ push :
33
+ if : github.ref == 'refs/heads/main' && github.repository == 'cortexproject/cortex-jsonnet'
34
+ needs : build
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ - uses : actions/checkout@v4
38
+ name : Checkout
39
+
40
+ - name : Download Docker Images Artifacts
41
+ uses : actions/download-artifact@v4
42
+ with :
43
+ name : build-image
44
+
45
+ - name : Load image
46
+ run : make load-build-image
47
+
48
+ - name : Login to Quay.io
49
+ uses : docker/#-action@v3
50
+ with :
51
+ registry : quay.io
52
+ username : ${{secrets.QUAY_REGISTRY_USER}}
53
+ password : ${{secrets.QUAY_REGISTRY_PASSWORD}}
54
+
55
+ - name : Push image
56
+ run : make publish-build-image
Original file line number Diff line number Diff line change @@ -3,8 +3,14 @@ name: CI
3
3
on :
4
4
push :
5
5
branches : [ main ]
6
+ paths-ignore :
7
+ - ' build-image/Dockerfile'
8
+ - ' .github/workflows/build-image.yaml'
6
9
pull_request :
7
10
branches : [ main ]
11
+ paths-ignore :
12
+ - ' build-image/Dockerfile'
13
+ - ' .github/workflows/build-image.yaml'
8
14
9
15
jobs :
10
16
lint :
@@ -15,12 +21,13 @@ jobs:
15
21
name : Checkout
16
22
with :
17
23
fetch-depth : 0
18
-
24
+
19
25
- name : " Lint mixin"
20
26
run : make lint-mixin
21
-
27
+
22
28
- name : " Lint playbooks"
23
29
run : make lint-playbooks
30
+
24
31
build :
25
32
runs-on : ubuntu-latest
26
33
container : quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
29
36
name : Checkout
30
37
with :
31
38
fetch-depth : 0
32
-
39
+
33
40
- name : " Build mixin"
34
41
run : make build-mixin
42
+
35
43
readme :
36
44
runs-on : ubuntu-latest
37
45
container : quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
@@ -40,10 +48,12 @@ jobs:
40
48
name : Checkout
41
49
with :
42
50
fetch-depth : 0
43
-
51
+
44
52
- name : " Test readme s3"
45
53
run : make test-readme/s3
54
+
46
55
- name : " Test readme azure"
47
56
run : make test-readme/azure
57
+
48
58
- name : " Test readme gcs"
49
59
run : make test-readme/gcs
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ cortex-mixin/out
3
3
cortex-mixin /vendor
4
4
/test-readme /
5
5
.vscode
6
+ build-image.tar
Original file line number Diff line number Diff line change 34
34
build-image :
35
35
docker build -t quay.io/cortexproject/cortex-jsonnet-build-image:$(shell git rev-parse --short HEAD) build-image
36
36
37
+ save-build-image :
38
+ docker save quay.io/cortexproject/cortex-jsonnet-build-image:$(shell git rev-parse --short HEAD) > build-image.tar
39
+
40
+ load-build-image :
41
+ docker load < build-image.tar
42
+
37
43
publish-build-image :
38
44
docker push quay.io/cortexproject/cortex-jsonnet-build-image:$(shell git rev-parse --short HEAD)
39
45
You can’t perform that action at this time.
0 commit comments