Skip to content

Commit

Permalink
Use standard action to build the image and enable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
chrkaatz committed Sep 28, 2023
1 parent 8565466 commit 79cb48a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
name: List the state of node modules - no cache hit
continue-on-error: true
run: npm list

Expand All @@ -68,9 +68,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Build an image from Dockerfile
run: |
docker build -t ${{ env.IMAGE_NAME }}:${{ github.sha }} .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: "${{ env.IMAGE_NAME }}:${{ github.sha }}"
push: false

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
Expand Down

0 comments on commit 79cb48a

Please sign in to comment.