File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push to Container Registry
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ env :
7
+ REGISTRY : ghcr.io
8
+ REPO_OWNER : ${{ github.repository_owner }}
9
+
10
+ jobs :
11
+ build-and-push :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Build with Maven
18
+ run : mvn clean install
19
+
20
+ - name : Log in Github Container Registry
21
+ uses : docker/login-action@v2
22
+ with :
23
+ registry : ${{ env.REGISTRY }}
24
+ username : ${{ github.actor }}
25
+ password : ${{ secrets.GH_TOKEN }}
26
+
27
+ - name : Extract image metadata
28
+ id : meta
29
+ uses : docker/metadata-action@v4
30
+ with :
31
+ images : ${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/spring-boot-redis-cache
32
+
33
+ - name : Build and push
34
+ uses : docker/build-push-action@v4
35
+ with :
36
+ context : .
37
+ file : Dockerfile
38
+ push : true
39
+ tags : ${{ steps.meta.outputs.tags }}
40
+ labels : ${{ steps.meta.outputs.labels }}
41
+ build-args : |
42
+ GITHUB_TOKEN=${{ secrets.GH_TOKEN }}
You can’t perform that action at this time.
0 commit comments