From 8d2e6ec3b640d919487ada3d0a4b890e410b7244 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Fri, 24 Jan 2025 07:49:02 +0200 Subject: [PATCH 1/4] add publish docker publish frontend --- .github/workflows/release-image.yml | 37 +++++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-image.yml diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml new file mode 100644 index 00000000..679a5ae8 --- /dev/null +++ b/.github/workflows/release-image.yml @@ -0,0 +1,37 @@ +name: Release image to DockerHub + +on: + workflow_dispatch: + push: + tags: ["v*.*.*"] + branches: + - main + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set tags + run: | + if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}; then + echo "TAGS=falkordb/code-graph-frontend:latest,falkordb/code-graph-frontend:${{ github.ref_name }}" >> $GITHUB_ENV + else + echo "TAGS=falkordb/code-graph-frontend:edge" >> $GITHUB_ENV + fi + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ env.TAGS }} diff --git a/Dockerfile b/Dockerfile index d5862299..d338bda6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use a Node.js base image -FROM node:20 +FROM node:22 # Set working directory WORKDIR /app From c4eb6b8bd2428dad277adf127a527a6fcf4775f8 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Fri, 24 Jan 2025 07:57:55 +0200 Subject: [PATCH 2/4] Update .github/workflows/release-image.yml Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> --- .github/workflows/release-image.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index 679a5ae8..e8db2035 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -33,5 +33,20 @@ jobs: with: context: . file: ./Dockerfile + push: false + tags: ${{ env.TAGS }} + + - name: Scan image for vulnerabilities + uses: aquasecurity/trivy-action@master + with: + image-ref: ${{ env.TAGS }} + format: 'table' + exit-code: '1' + severity: 'CRITICAL,HIGH' + + - name: Push image + uses: docker/build-push-action@v5 + with: + context: . push: true tags: ${{ env.TAGS }} From d639e7c554e5ac3fdbc2ba9517c8ad279288bb88 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Fri, 24 Jan 2025 08:11:19 +0200 Subject: [PATCH 3/4] Update Trivy action to version 0.29.0 --- .github/workflows/release-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index e8db2035..6bd5be5f 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -37,7 +37,7 @@ jobs: tags: ${{ env.TAGS }} - name: Scan image for vulnerabilities - uses: aquasecurity/trivy-action@master + uses: aquasecurity/trivy-action@0.29.0 with: image-ref: ${{ env.TAGS }} format: 'table' From 12d3466644802042c4573590952e63480dfdfc68 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Fri, 24 Jan 2025 10:37:29 +0200 Subject: [PATCH 4/4] Remove vulnerability scan step from workflow --- .github/workflows/release-image.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index 6bd5be5f..679a5ae8 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -33,20 +33,5 @@ jobs: with: context: . file: ./Dockerfile - push: false - tags: ${{ env.TAGS }} - - - name: Scan image for vulnerabilities - uses: aquasecurity/trivy-action@0.29.0 - with: - image-ref: ${{ env.TAGS }} - format: 'table' - exit-code: '1' - severity: 'CRITICAL,HIGH' - - - name: Push image - uses: docker/build-push-action@v5 - with: - context: . push: true tags: ${{ env.TAGS }}