This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Create new Docker-Image and Deploy
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ version :
7
+ description : ' Version of the new image'
8
+ required : true
9
+ default : ' latest'
10
+
11
+ env :
12
+ IMAGE_NAME : rest
13
+ VERSION : ${{ github.event.inputs.version }}
14
+
15
+ jobs :
16
+ create-new-docker-image :
17
+ runs-on : ubuntu-latest
18
+
19
+ steps :
20
+ - uses : actions/checkout@v2
21
+ - name : Set up JDK
22
+ uses : actions/setup-java@v1
23
+ with :
24
+ java-version : ' 11.0.8'
25
+ architecture : x64
26
+ - name : build image with docker
27
+ run : mvn spring-boot:build-image -f pom.xml
28
+
29
+ - name : Log into GitHub Container Registry
30
+ # Secret with `read:packages` and `write:packages` scopes saved as `CR_PAT`
31
+ run : echo "${{ secrets.DOCKER_PW }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
32
+
33
+ - name : Push image to GitHub Container Registry
34
+ run : |
35
+ IMAGE_ID=$(docker images $IMAGE_NAME -q)
36
+
37
+ echo IMAGE_ID=$IMAGE_ID
38
+ echo VERSION=$VERSION
39
+
40
+ docker tag $IMAGE_ID docker.pkg.github.com/filefighter/restapi/$IMAGE_NAME:$VERSION
41
+ docker push docker.pkg.github.com/filefighter/restapi/$IMAGE_NAME:$VERSION
You can’t perform that action at this time.
0 commit comments