File tree Expand file tree Collapse file tree 1 file changed +30
-4
lines changed Expand file tree Collapse file tree 1 file changed +30
-4
lines changed Original file line number Diff line number Diff line change 1
- name : Docker Image CI
1
+ name : Charge Point Simulator image release
2
2
3
3
on :
4
4
push :
5
5
branches : [ "master" ]
6
6
pull_request :
7
7
branches : [ "master" ]
8
8
9
+ env :
10
+ REGISTRY : ghcr.io
11
+ IMAGE_NAME : ${{ github.repository }}
12
+
9
13
jobs :
10
14
11
15
build :
12
16
13
17
runs-on : ubuntu-latest
14
18
15
19
steps :
16
- - uses : actions/checkout@v3
20
+ - name : Checkout repository
21
+ uses : actions/checkout@v3
22
+
23
+ - name : Log in to the Container registry
24
+ uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25
+ with :
26
+ registry : ${{ env.REGISTRY }}
27
+ username : ${{ github.actor }}
28
+ password : ${{ secrets.GITHUB_TOKEN }}
29
+
17
30
- name : Set up JDK 17
18
31
uses : actions/setup-java@v1
19
32
with :
20
33
java-version : ' 17'
21
34
distribution : ' adopt'
22
35
cache : maven
36
+
23
37
- name : Build with Maven
24
38
run : mvn clean install
25
- - name : Build the Docker image
26
- run : docker build . --file Dockerfile --tag ocpp-charge-point-emulator-cli:$(date +%s)
39
+
40
+ - name : Extract metadata (tags, labels) for Docker
41
+ id : meta
42
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
43
+ with :
44
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45
+
46
+ - name : Build and push Docker image
47
+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
48
+ with :
49
+ context : .
50
+ push : true
51
+ tags : ${{ steps.meta.outputs.tags }}
52
+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments