Skip to content

Commit cc50823

Browse files
author
Dennis Labordus
authored
Merge pull request #23 from com-pas/docker_hub_publish
Added Github Action for deploying Docker image to Docker Hub
2 parents b9e75b6 + 447b8fd commit cc50823

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Docker Hub Deployment
6+
7+
on:
8+
release:
9+
types: [released]
10+
11+
jobs:
12+
push_to_registry:
13+
name: Build and publish
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v2
18+
- name: Login to Docker Hub
19+
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
20+
- name: Build and publish Docker Image
21+
run: ./gradlew clean build -Dquarkus-profile=publishNativeImage
22+
env:
23+
GITHUB_USERNAME: "OWNER"
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies {
1616
implementation 'io.quarkus:quarkus-smallrye-openapi'
1717
implementation 'io.quarkus:quarkus-smallrye-health'
1818
implementation 'io.quarkus:quarkus-resteasy-jaxb'
19+
implementation 'io.quarkus:quarkus-container-image-docker'
1920

2021
implementation 'org.lfenergy.compas:core-commons'
2122
implementation project(':service')

app/src/main/resources/application.properties

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ quarkus.http.root-path = /compas-scl-data-service/
88
quarkus.log.level = INFO
99
quarkus.log.category."org.lfenergy.compas.scl.data".level = INFO
1010

11-
# BaseX Client Configuration
12-
basex.host = localhost
13-
basex.port = 1984
14-
basex.username = admin
15-
basex.password = admin
11+
# BaseX configuration
12+
basex.host = localhost
13+
basex.port = 1984
14+
basex.username = admin
15+
basex.password = admin
1616

1717
# Dev Profile overrides.
1818
%dev.quarkus.http.port = 9090
1919
%dev.quarkus.http.cors = true
2020

2121
%dev.quarkus.log.level = DEBUG
2222
%dev.quarkus.log.category."org.lfenergy.compas.scl.data".level = DEBUG
23+
24+
# Properties only used for publishing a native docker image (default to Docker Hub)
25+
%publishNativeImage.quarkus.native.container-build=true
26+
%publishNativeImage.quarkus.container-image.build=true
27+
%publishNativeImage.quarkus.container-image.group=lfenergycompas
28+
%publishNativeImage.quarkus.container-image.name=compas-scl-data-service
29+
%publishNativeImage.quarkus.container-image.push=true

0 commit comments

Comments
 (0)