Skip to content

Commit 2eae7b6

Browse files
committed
add SHA environment variable and build step for analysis in CI workflow
1 parent 19520da commit 2eae7b6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
REGISTRY: docker.io
1313
DOCKER_USERNAME: argentinaluiz
1414
IMAGE_NAME: argentinaluiz/docker-prod-test
15-
15+
SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
1616
jobs:
1717
ci:
1818

@@ -53,4 +53,17 @@ jobs:
5353
- name: Run tests
5454
run: echo "Running tests..."
5555

56-
56+
- name: Build for analysis
57+
id: build-for-analysis
58+
uses: docker/[email protected]
59+
with:
60+
context: ./src/ci/nestjs-project
61+
file: ./src/ci/nestjs-project/Dockerfile.prod
62+
push: false
63+
load: true
64+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.SHA }}
65+
cache-from: type=gha
66+
cache-to: type=gha,mode=max
67+
secrets: |
68+
github_token=${{ secrets.MY_GITHUB_TOKEN }}
69+

0 commit comments

Comments
 (0)