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