From 80530bd83bbf136c79b4131bc0d3159eb8184fe7 Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Thu, 28 Nov 2024 09:15:58 +0100 Subject: [PATCH] Fix GHA --- .github/workflows/build-scan-push.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-scan-push.yml b/.github/workflows/build-scan-push.yml index d076119..650eed6 100644 --- a/.github/workflows/build-scan-push.yml +++ b/.github/workflows/build-scan-push.yml @@ -21,20 +21,22 @@ jobs: with: dockerfile: Dockerfile - - name: Lint Shell Script with ShellCheck + - name: Lint Shell Scripts with ShellCheck uses: ludeeus/action-shellcheck@master - - name: Lint Kubernetes resources with KubeLinter + - name: Lint Kubernetes Resources with KubeLinter id: kube-lint-scan uses: stackrox/kube-linter-action@v1 with: directory: k8s config: .kube-linter/config.yaml + # Set up Docker Buildx for multi-architecture builds - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers + # Cache Docker layers for faster builds + - name: Cache Docker Layers uses: actions/cache@v3 with: path: /tmp/.buildx-cache @@ -42,7 +44,7 @@ jobs: restore-keys: | ${{ runner.os }}-buildx- - - name: Build Docker image + - name: Build and Push Docker Image uses: docker/build-push-action@v4 with: context: . @@ -53,8 +55,9 @@ jobs: ghcr.io/${{ github.repository_owner }}/docker-bitlbee:latest cache-from: type=gha cache-to: type=gha,mode=max + push: true - - name: Scan Docker image for vulnerabilities with Trivy + - name: Scan Docker Image for Vulnerabilities with Trivy uses: aquasecurity/trivy-action@master with: image-ref: ${{ secrets.DOCKER_USERNAME }}/docker-bitlbee:latest @@ -68,8 +71,3 @@ jobs: with: name: trivy-scan-results path: trivy-results.json - - - name: Push Docker image - run: | - docker push ${{ secrets.DOCKER_USERNAME }}/docker-bitlbee:latest - docker push ghcr.io/${{ github.repository_owner }}/docker-bitlbee:latest