Skip to content

Commit eafa8a8

Browse files
authored
Merge pull request #62 from FalkorDB/gkorland-patch-1
Add publish docker backend
2 parents 6b86a29 + 588af7b commit eafa8a8

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/release-image.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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@0.29.0
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 }}

0 commit comments

Comments
 (0)