@@ -2,8 +2,11 @@ name: HMDA Docker Hub Image Push
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - master
5
+ tags :
6
+ - ' *' # Push events to every tag not containing /
7
+
8
+ env :
9
+ REGISTRY : hmda/hmda-platform
7
10
8
11
jobs :
9
12
push_to_dockerhub :
@@ -14,39 +17,21 @@ jobs:
14
17
- name : Check out the repo
15
18
uses : actions/checkout@v4
16
19
17
- - name : Log in to Docker Hub
18
- uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
19
- with :
20
- username : ${{ secrets.DOCKERHUB_USERNAME }}
21
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
20
+ - name : Setup sbt launcher
21
+ uses : sbt/setup-sbt@v1
22
22
23
23
- name : Build image of HMDA Platform only
24
24
run : |
25
- sbt -batch clean hmda-platform/docker:publishLocal
26
- continue-on-error : true
25
+ sbt "project hmda-platform" dockerPublishLocalSkipTests
27
26
28
27
- name : Tag Docker image
29
- run : docker tag $(docker images --filter=reference="hmda/hmda-platform:latest" --format "{{.ID}}") ${{ secrets.DOCKERHUB_USERNAME }}/hmda:latest
30
-
31
- - name : Push image to Docker Hub
32
- run : docker push ${{ secrets.DOCKERHUB_USERNAME }}/hmda:latest
28
+ run : docker tag $(docker images --filter=reference="hmda/hmda-platform:latest" --format "{{.ID}}") ${{ env.REGISTRY }}:${{ github.ref_name }}
33
29
34
- - name : Run Docker Scout CVE scan
35
- if : ${{ github.event_name != 'pull_request_target' }}
36
- uses : docker/scout-action@v1
37
- with :
38
- command : cves
39
- image : ${{ secrets.DOCKERHUB_USERNAME }}/hmda:latest
40
- sarif-file : sarif.output.json
41
- summary : true
42
-
43
- - name : Upload CVE scan to artifact
44
- if : ${{ github.event_name != 'pull_request_target' }}
45
- uses : github/codeql-action/upload-sarif@v2
30
+ - name : Log in to Docker Hub
31
+ uses : docker/login-action@v3
46
32
with :
47
- sarif_file : sarif.output.json
33
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
34
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
48
35
49
- - name : Post comment with report link
50
- uses : thollander/actions-comment-pull-request@v3
51
- with :
52
- message : CVE scan report generated by Docker Scout are available. Check the Actions tab to download the report.
36
+ - name : Push image to Docker Hub
37
+ run : docker push ${{ env.REGISTRY }}:${{ github.ref_name }}
0 commit comments