File tree 3 files changed +52
-20
lines changed 3 files changed +52
-20
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,13 @@ name: pr
2
2
3
3
on : [pull_request]
4
4
5
+
5
6
permissions : {}
6
7
8
+ env :
9
+ IMAGE : openpolicyagent/conftest
10
+ PLATFORMS : linux/amd64,linux/arm64
11
+
7
12
jobs :
8
13
style :
9
14
runs-on : ubuntu-latest
60
65
- name : build
61
66
run : make build
62
67
68
+ - name : setup docker buildx
69
+ run : docker buildx create --name conftestbuild --use
70
+
71
+ - name : Build Docker image
72
+ uses : docker/build-push-action@v6
73
+ with :
74
+ context : .
75
+ push : false
76
+ tags : |
77
+ ${{ env.IMAGE }}:latest
78
+ platforms : ${{ env.PLATFORMS }}
79
+
63
80
- name : unit test
64
81
run : make test
65
82
Original file line number Diff line number Diff line change 4
4
push :
5
5
tags :
6
6
- ' v*'
7
+ env :
8
+ IMAGE : openpolicyagent/conftest
9
+ PLATFORMS : linux/amd64,linux/arm64
7
10
8
11
jobs :
9
12
release :
@@ -36,10 +39,37 @@ jobs:
36
39
- name : setup docker buildx
37
40
run : docker buildx create --name conftestbuild --use
38
41
39
- - name : push images
40
- env :
41
- VERSION : ${{ steps.get-version.outputs.VERSION }}
42
- run : make push TAG=$VERSION
42
+ - name : Build and push Docker image
43
+ uses : docker/build-push-action@v6
44
+ with :
45
+ context : .
46
+ push : true
47
+ build-args : |
48
+ VERSION=${{ steps.get-version.outputs.VERSION }}
49
+ tags : |
50
+ ${{ env.IMAGE }}:${{ steps.get-version.outputs.VERSION }}
51
+ platforms : ${{ env.PLATFORMS }}
52
+
53
+ - name : Build and push Docker latest image
54
+ uses : docker/build-push-action@v6
55
+ with :
56
+ context : .
57
+ push : true
58
+ build-args : |
59
+ VERSION=${{ steps.get-version.outputs.VERSION }}
60
+ tags : |
61
+ ${{ env.IMAGE }}:latest
62
+ platforms : ${{ env.PLATFORMS }}
63
+
64
+ - name : Build and push examples image
65
+ uses : docker/build-push-action@v6
66
+ with :
67
+ context : .
68
+ push : true
69
+ target : examples
70
+ tags : |
71
+ ${{ env.IMAGE }}:examples
72
+ platforms : ${{ env.PLATFORMS }}
43
73
44
74
- name : setup go
45
75
uses : actions/setup-go@v4
52
82
args : release --clean
53
83
version : " ~> v1"
54
84
env :
55
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 64
64
#
65
65
# #@ Releases
66
66
#
67
-
68
- .PHONY : image
69
- image : # # Builds a Docker image for Conftest.
70
- @$(DOCKER ) build . -t $(IMAGE ) :latest
71
-
72
- .PHONY : examples
73
- examples : # # Builds the examples Docker image.
74
- @$(DOCKER ) build . --target examples -t $(IMAGE ) :examples
75
-
76
- .PHONY : push
77
- push : # # Pushes the examples and Conftest image to DockerHub. Requires `TAG` parameter.
78
- @test -n " $( TAG) " || (echo " TAG parameter not set." && exit 1)
79
- @$(DOCKER ) buildx build . --push --build-arg VERSION=" $( TAG) " -t $(IMAGE ) :$(TAG ) --platform $(DOCKER_PLATFORMS )
80
- @$(DOCKER ) buildx build . --push --build-arg VERSION=" $( TAG) " -t $(IMAGE ) :latest --platform $(DOCKER_PLATFORMS )
81
- @$(DOCKER ) buildx build . --push --target examples -t $(IMAGE ) :examples --platform $(DOCKER_PLATFORMS )
You can’t perform that action at this time.
0 commit comments