File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 4
4
5
5
name : Docker Hub Deployment
6
6
7
- on :
8
- release :
9
- types : [released]
7
+ on : push
10
8
11
9
jobs :
12
10
push_to_registry :
@@ -15,10 +13,28 @@ jobs:
15
13
steps :
16
14
- name : Check out the repo
17
15
uses : actions/checkout@v2
16
+ - name : Extract tag name
17
+ id : extract_tagname
18
+ shell : bash
19
+ # Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
20
+ run : echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
18
21
- name : Login to Docker Hub
19
- run : echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
20
- - name : Build and publish Docker Image
22
+ uses : docker/login-action@v1
23
+ with :
24
+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
25
+ password : ${{ secrets.DOCKER_HUB_PASSWORD }}
26
+ - name : Build Docker Image
21
27
run : ./gradlew clean build -Dquarkus-profile=publishNativeImage
22
28
env :
23
29
GITHUB_USERNAME : " OWNER"
24
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31
+ - name : Build and push image to Docker Hub
32
+ uses : docker/build-push-action@v2
33
+ with :
34
+ # Set the context to use the current directory and not execute it's own git checkout.
35
+ context : .
36
+ push : true
37
+ # Tag the images using the tagname and also latest.
38
+ tags : |
39
+ lfenergycompas/compas-scl-data-service:${{ steps.extract_tagname.outputs.tagname }}
40
+ lfenergycompas/compas-scl-data-service:latest
Original file line number Diff line number Diff line change @@ -26,4 +26,3 @@ basex.password = admin
26
26
%publishNativeImage.quarkus.container-image.build =true
27
27
%publishNativeImage.quarkus.container-image.group =lfenergycompas
28
28
%publishNativeImage.quarkus.container-image.name =compas-scl-data-service
29
- %publishNativeImage.quarkus.container-image.push =true
You can’t perform that action at this time.
0 commit comments