Skip to content

Commit 7acef6c

Browse files
committed
Prepare release
1 parent 5b77a48 commit 7acef6c

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ on: [push]
33

44
jobs:
55

6-
build-java:
6+
build-application:
7+
name: Build application
78
runs-on: ubuntu-latest
89
environment: dockerhub
910
permissions:
@@ -33,10 +34,24 @@ jobs:
3334
password: ${{ secrets.DOCKERHUB_TOKEN }}
3435
- name: Set up Docker
3536
uses: docker/setup-buildx-action@v3
36-
- name: Build and push Docker image
37+
- name: Build Docker image
3738
uses: docker/build-push-action@v5
3839
with:
3940
context: .
4041
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

0 commit comments

Comments
 (0)