File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Release image to DockerHub
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ tags : ["v*.*.*"]
7
+ branches :
8
+ - main
9
+
10
+ jobs :
11
+ build-and-release :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Set tags
18
+ run : |
19
+ if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}; then
20
+ echo "TAGS=falkordb/code-graph-backend:latest,falkordb/code-graph-backend:${{ github.ref_name }}" >> $GITHUB_ENV
21
+ else
22
+ echo "TAGS=falkordb/code-graph-backend:edge" >> $GITHUB_ENV
23
+ fi
24
+
25
+ - name : Login to DockerHub
26
+ uses : docker/login-action@v3
27
+ with :
28
+ username : ${{ secrets.DOCKER_USERNAME }}
29
+ password : ${{ secrets.DOCKER_PASSWORD }}
30
+
31
+ - name : Build image
32
+ uses : docker/build-push-action@v5
33
+ with :
34
+ context : .
35
+ file : ./Dockerfile
36
+ push : false
37
+ tags : ${{ env.TAGS }}
38
+
39
+ - name : Scan image for vulnerabilities
40
+ uses : aquasecurity/trivy-action@master
41
+ with :
42
+ image-ref : ${{ env.TAGS }}
43
+ format : ' table'
44
+ exit-code : ' 1'
45
+ severity : ' CRITICAL,HIGH'
46
+
47
+ - name : Push image
48
+ uses : docker/build-push-action@v5
49
+ with :
50
+ context : .
51
+ push : true
52
+ tags : ${{ env.TAGS }}
You can’t perform that action at this time.
0 commit comments