File tree Expand file tree Collapse file tree 4 files changed +77
-4
lines changed Expand file tree Collapse file tree 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/login-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
33on :
44 push :
55 branches : [ main ]
6+ paths-ignore :
7+ - ' build-image/Dockerfile'
8+ - ' .github/workflows/build-image.yaml'
69 pull_request :
710 branches : [ main ]
11+ paths-ignore :
12+ - ' build-image/Dockerfile'
13+ - ' .github/workflows/build-image.yaml'
814
915jobs :
1016 lint :
@@ -15,12 +21,13 @@ jobs:
1521 name : Checkout
1622 with :
1723 fetch-depth : 0
18-
24+
1925 - name : " Lint mixin"
2026 run : make lint-mixin
21-
27+
2228 - name : " Lint playbooks"
2329 run : make lint-playbooks
30+
2431 build :
2532 runs-on : ubuntu-latest
2633 container : quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
2936 name : Checkout
3037 with :
3138 fetch-depth : 0
32-
39+
3340 - name : " Build mixin"
3441 run : make build-mixin
42+
3543 readme :
3644 runs-on : ubuntu-latest
3745 container : quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
@@ -40,10 +48,12 @@ jobs:
4048 name : Checkout
4149 with :
4250 fetch-depth : 0
43-
51+
4452 - name : " Test readme s3"
4553 run : make test-readme/s3
54+
4655 - name : " Test readme azure"
4756 run : make test-readme/azure
57+
4858 - name : " Test readme gcs"
4959 run : make test-readme/gcs
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ cortex-mixin/out
33cortex-mixin /vendor
44/test-readme /
55.vscode
6+ build-image.tar
Original file line number Diff line number Diff line change 3434build-image :
3535 docker build -t quay.io/cortexproject/cortex-jsonnet-build-image:$(shell git rev-parse --short HEAD) build-image
3636
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+
3743publish-build-image :
3844 docker push quay.io/cortexproject/cortex-jsonnet-build-image:$(shell git rev-parse --short HEAD)
3945
You can’t perform that action at this time.
0 commit comments