@@ -10,16 +10,13 @@ name: CI
10
10
on :
11
11
push :
12
12
branches : [ "main" ]
13
+ tags : ["*"]
13
14
pull_request :
14
15
branches : [ "main" ]
15
16
16
17
jobs :
17
18
build :
18
19
runs-on : ubuntu-24.04
19
- # runs-on: ${{matrix.os}}
20
- # strategy:
21
- # matrix:
22
- # os: [ubuntu-24.04, ubuntu-latest]
23
20
24
21
steps :
25
22
- uses : actions/checkout@v4
@@ -35,31 +32,30 @@ jobs:
35
32
- name : Build with Gradle Wrapper
36
33
run : ./gradlew build
37
34
38
- - name : Build and Push Docker Image
39
- uses : mr-smithers-excellent/docker-build-push@v4
35
+ - name : Archive build artifacts
36
+ uses : actions/upload-artifact@v3
40
37
with :
41
- image : asjn83/demo
42
- tag : latest
43
- registry : docker.io
44
- username : ${{ secrets.DOCKER_USERNAME }}
45
- password : ${{ secrets.DOCKER_PASSWORD }}
46
-
47
-
48
- dependency-submission :
49
-
38
+ name : build-artifacts
39
+ path : |
40
+ build/libs
41
+ Dockerfile
42
+
43
+ publish :
44
+ needs : build
45
+ if : startsWith(github.ref, 'refs/tags/')
50
46
runs-on : ubuntu-24.04
51
- permissions :
52
- contents : write
53
47
54
48
steps :
55
- - uses : actions/checkout@v4
56
- - name : Set up JDK 17
57
- uses : actions/setup-java@v4
58
- with :
59
- java-version : ' 17'
60
- distribution : ' temurin'
61
-
62
- # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
63
- # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
64
- - name : Generate and submit dependency graph
65
- uses : gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
49
+ - name : Download build artifacts
50
+ uses : actions/download-artifact@v3
51
+ with :
52
+ name : build-artifacts
53
+
54
+ - name : Build and Push Docker Image
55
+ uses : mr-smithers-excellent/docker-build-push@v4
56
+ with :
57
+ image : asjn83/demo
58
+ tag : latest
59
+ registry : docker.io
60
+ username : ${{ secrets.DOCKER_USERNAME }}
61
+ password : ${{ secrets.DOCKER_PASSWORD }}
0 commit comments