File tree 1 file changed +31
-7
lines changed
1 file changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -20,19 +20,43 @@ jobs:
20
20
21
21
steps :
22
22
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
23
- - name : Build the Docker image
24
- run : make compose/rebuild
23
+
24
+ - name : Build and push
25
+ uses : docker/build-push-action@v6
26
+ with :
27
+ context : .
28
+ tags : |
29
+ ${{ env.IMAGE_NAME }}:latest
30
+ ${{ env.IMAGE_NAME }}:${{ github.sha }}
31
+
32
+ - name : Upload artifact
33
+ uses : actions/upload-artifact@v4
34
+ with :
35
+ name : algorithm-exercises-ts:${{ github.sha }}
36
+ path : /tmp/algorithm-exercises-ts:${{ github.sha }}.tar
37
+
25
38
- name : Lint in Docker image
26
39
run : make compose/lint
27
40
- name : Test in Docker image
28
41
run : make compose/test
29
42
- name : Run in Docker image
30
43
run : make compose/run
31
- - name : Tag Docker image
32
- run : >
33
- docker tag
34
- ${{ env.IMAGE_NAME }}:latest
35
- ${{ env.IMAGE_NAME }}:${{ github.sha }}
44
+
45
+ scan :
46
+ name : " Snyk Container"
47
+ runs-on : ubuntu-latest
48
+ needs : build
49
+ steps :
50
+ - name : Download artifact
51
+ uses : actions/download-artifact@v4
52
+ with :
53
+ name : myimage
54
+ path : /tmp
55
+
56
+ - name : Load image
57
+ run : |
58
+ docker load --input /tmp/myimage.tar
59
+ docker image ls -a
36
60
37
61
- name : Run Snyk to check Docker image for vulnerabilities
38
62
# Snyk can be used to break the build when it detects vulnerabilities.
You can’t perform that action at this time.
0 commit comments