File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 1
1
name : Flightlog Build
2
2
on : [push]
3
+ permissions : write-all
3
4
4
5
jobs :
5
6
6
- build-java :
7
+ build-application :
8
+ name : Build application
7
9
runs-on : ubuntu-latest
8
10
environment : dockerhub
9
11
permissions :
16
18
- name : Setup Java
17
19
uses : actions/setup-java@v3
18
20
with :
19
- java-version : ' 21'
20
21
distribution : ' temurin'
22
+ java-version : ' 21'
23
+ cache : ' maven'
21
24
- name : Build application
22
25
run : |-
23
26
mvn --batch-mode clean package
@@ -33,10 +36,24 @@ jobs:
33
36
password : ${{ secrets.DOCKERHUB_TOKEN }}
34
37
- name : Set up Docker
35
38
uses : docker/setup-buildx-action@v3
36
- - name : Build and push Docker image
39
+ - name : Build Docker image
37
40
uses : docker/build-push-action@v5
38
41
with :
39
42
context : .
40
43
file : ./Dockerfile
41
- push : false
42
- tags : ${{ secrets.DOCKERHUB_USERNAME }}/flightlog:latest
44
+ push : ${{ github.ref_type == 'tag' && startsWith(github.action_ref, 'v') }}
45
+ tags : |
46
+ ${{ secrets.DOCKERHUB_USERNAME }}/flightlog:latest
47
+ ${{ secrets.DOCKERHUB_USERNAME }}/flightlog:${{ github.action_ref }}
48
+ - name : Create Release
49
+ if : ${{ github.ref_type == 'tag' && startsWith(github.action_ref, 'v') }}
50
+ uses : actions/create-release@v1
51
+ env :
52
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
53
+ with :
54
+ tag_name : ${{ github.ref }}
55
+ release_name : ${{ github.ref }}
56
+ body : |
57
+ Release automatically created by GitHub Actions
58
+ draft : false
59
+ prerelease : false
You can’t perform that action at this time.
0 commit comments