Skip to content

Commit 1372b37

Browse files
committed
Add image scanning
1 parent 539b8ba commit 1372b37

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.github/workflows/push_to_canary.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Push To Canary
22

33
on:
44
push:
5-
branches:
6-
- 'main'
5+
# branches:
6+
# - 'main'
77

88
concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
@@ -121,6 +121,19 @@ jobs:
121121
docker build "." -f "docker-init/frontend/Dockerfile" -t "frontend-image:latest" --build-arg "API_BASE_URL=http://app:9000"
122122

123123

124+
- name: Scan container images
125+
uses: aquasecurity/trivy-action@master
126+
with:
127+
image-ref: |
128+
aws-app-image:latest
129+
gcp-app-image:latest
130+
frontend-image:latest
131+
format: 'table'
132+
exit-code: '1'
133+
ignore-unfixed: true
134+
vuln-type: 'os,library'
135+
severity: 'CRITICAL,HIGH'
136+
124137
- name: Configure AWS Credentials
125138
uses: aws-actions/configure-aws-credentials@v4
126139
with:
@@ -137,7 +150,7 @@ jobs:
137150
- name: Tag, and push quickstart image to Amazon ECR
138151
env:
139152
ECR_REPOSITORY: ${{steps.login-ecr.outputs.registry}}/${{env.AWS_QUICKSTART_REPOSITORY}}
140-
IMAGE_TAG: main
153+
IMAGE_TAG: canary
141154
shell: bash
142155
run: |
143156
set -eo pipefail
@@ -149,7 +162,7 @@ jobs:
149162
- name: Tag, and push app image to Amazon ECR
150163
env:
151164
ECR_REGISTRY: ${{steps.login-ecr.outputs.registry}}/${{env.AWS_APP_REPOSITORY}}
152-
IMAGE_TAG: main
165+
IMAGE_TAG: canary
153166
shell: bash
154167
run: |
155168
set -eo pipefail
@@ -169,7 +182,7 @@ jobs:
169182
shell: bash
170183
env:
171184
ECR_REGISTRY: ${{steps.login-ecr.outputs.registry}}/${{env.AWS_FRONTEND_REPOSITORY}}
172-
IMAGE_TAG: main
185+
IMAGE_TAG: canary
173186
run: |
174187
set -eo pipefail
175188
docker tag "frontend-image:latest" "${{env.ECR_REGISTRY}}:${{env.IMAGE_TAG}}"
@@ -202,7 +215,7 @@ jobs:
202215
shell: bash
203216
env:
204217
GAR_QUICKSTART_REGISTRY: ${{secrets.GCP_REGION}}-docker.pkg.dev/${{secrets.GCP_PROJECT_ID}}/${{env.GAR_QUICKSTART_REPOSITORY}}
205-
IMAGE_TAG: main
218+
IMAGE_TAG: canary
206219
run: |
207220
set -eo pipefail
208221
docker tag "gcp-quickstart-image:latest" "${{env.GAR_QUICKSTART_REGISTRY}}:${{env.IMAGE_TAG}}"
@@ -220,7 +233,7 @@ jobs:
220233
shell: bash
221234
env:
222235
GAR_APP_REGISTRY: ${{secrets.GCP_REGION}}-docker.pkg.dev/${{secrets.GCP_PROJECT_ID}}/${{env.GAR_APP_REPOSITORY}}
223-
IMAGE_TAG: main
236+
IMAGE_TAG: canary
224237
run: |
225238
set -eo pipefail
226239
docker tag "gcp-app-image:latest" "${{env.GAR_APP_REGISTRY}}:${{env.IMAGE_TAG}}"
@@ -238,7 +251,7 @@ jobs:
238251
shell: bash
239252
env:
240253
GAR_FRONTEND_REGISTRY: ${{secrets.GCP_REGION}}-docker.pkg.dev/${{secrets.GCP_PROJECT_ID}}/${{env.GAR_FRONTEND_REPOSITORY}}
241-
IMAGE_TAG: main
254+
IMAGE_TAG: canary
242255
run: |
243256
set -eo pipefail
244257
docker tag "frontend-image:latest" "${{env.GAR_FRONTEND_REGISTRY}}:${{env.IMAGE_TAG}}"

0 commit comments

Comments
 (0)