Skip to content

Commit e855ccf

Browse files
committed
Prepare release
1 parent 5b77a48 commit e855ccf

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Flightlog Build
22
on: [push]
3+
permissions: write-all
34

45
jobs:
56

6-
build-java:
7+
build-application:
8+
name: Build application
79
runs-on: ubuntu-latest
810
environment: dockerhub
911
permissions:
@@ -16,8 +18,9 @@ jobs:
1618
- name: Setup Java
1719
uses: actions/setup-java@v3
1820
with:
19-
java-version: '21'
2021
distribution: 'temurin'
22+
java-version: '21'
23+
cache: 'maven'
2124
- name: Build application
2225
run: |-
2326
mvn --batch-mode clean package
@@ -33,10 +36,24 @@ jobs:
3336
password: ${{ secrets.DOCKERHUB_TOKEN }}
3437
- name: Set up Docker
3538
uses: docker/setup-buildx-action@v3
36-
- name: Build and push Docker image
39+
- name: Build Docker image
3740
uses: docker/build-push-action@v5
3841
with:
3942
context: .
4043
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

0 commit comments

Comments
 (0)