diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 4c3c9e2..794a6f4 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -43,7 +43,7 @@ jobs: - name: Build an image from Dockerfile run: | - docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} -f Dockerfile1 . + docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} -f Dockerfile . - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master @@ -61,6 +61,9 @@ jobs: with: sarif_file: 'trivy-results.sarif' + - name: Push the image if scan passes + run: | + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} # - name: Build and push Docker image # uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc @@ -68,4 +71,4 @@ jobs: # context: . # push: true # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + # labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 7f662e2..0440e4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ WORKDIR /opt/blog-search/blog RUN hugo # Serve the site -FROM nginx:1.23.3-alpine AS server +FROM nginx:1.25.4-alpine AS server COPY --from=builder /opt/blog-search/blog/public/ /var/www/html/public/ EXPOSE 6443/tcp CMD ["/usr/sbin/nginx", "-g", "daemon off;"]