Skip to content

Commit 9097d83

Browse files
committed
cap08-09-montando-step-do-build-final
1 parent e20af90 commit 9097d83

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,32 @@ jobs:
9999
with:
100100
sarif_file: sarif.output.json
101101

102+
- name: Extract Docker metadata
103+
id: meta
104+
if: ${{ github.event_name != 'pull_request' }}
105+
uses: docker/[email protected]
106+
with:
107+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
108+
labels: |
109+
org.opencontainers.image.revision=${{ env.SHA }}
110+
tags: |
111+
type=edge,branch=$repo.default_branch
112+
type=semver,pattern=v{{version}}
113+
type=sha,prefix=,suffix=,format=short
114+
115+
- name: Build final
116+
id: build-final
117+
if: ${{ github.event_name != 'pull_request' }}
118+
uses: docker/[email protected]
119+
with:
120+
context: ./src/ci/nestjs-project
121+
file: ./src/ci/nestjs-project/Dockerfile.prod
122+
push: true
123+
tags: ${{ steps.meta.outputs.tags }}
124+
labels: ${{ steps.meta.outputs.labels }}
125+
cache-from: type=gha
126+
cache-to: type=gha,mode=max
127+
provenance: mode=max
128+
sbom: true
129+
secrets: |
130+
github_token=${{ secrets.MY_GITHUB_TOKEN }}

src/ci/nestjs-project/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ async function bootstrap() {
66
await app.listen(process.env.PORT ?? 3000);
77
}
88
bootstrap();
9+

0 commit comments

Comments
 (0)