Skip to content

Commit a1ebc60

Browse files
committed
Adds step to build and package docker image
1 parent 92f7c01 commit a1ebc60

File tree

3 files changed

+306
-17
lines changed

3 files changed

+306
-17
lines changed

.github/workflows/maven.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
91
name: Java CI with Maven
102

113
on:
@@ -14,11 +6,22 @@ on:
146
pull_request:
157
branches: [ "master" ]
168

9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
16+
1717
jobs:
1818
build:
19-
2019
runs-on: ubuntu-latest
21-
20+
env:
21+
QUARKUS_APPLICATION_VERSION: ${{ github.run_number }}
22+
QUARKUS_CONTAINER_IMAGE_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
23+
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ github.actor }}
24+
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
2225
steps:
2326
- uses: actions/checkout@v3
2427
- name: Set up JDK 17
@@ -27,5 +30,7 @@ jobs:
2730
java-version: '17'
2831
distribution: 'temurin'
2932
cache: maven
30-
- name: Build with Maven
31-
run: ./mvnw -B package
33+
- name: Build and conditionally push container image with Maven
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: ./mvnw -B package -Dquarkus.container-image.build=true

leaderboard.iml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<orderEntry type="sourceFolder" forTests="false" />
6+
</component>
37
<component name="Quarkus Tools">
48
<option name="hash" value="-1943172620" />
59
<option name="version" value="1" />

0 commit comments

Comments
 (0)