Skip to content

Commit 77677d9

Browse files
author
AlexRogalskiy
committed
Added info on workflows
Updates on github-actions
1 parent 2c50a56 commit 77677d9

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/docker.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Docker build and container scan
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Docker build
16+
run: |
17+
docker build . --file Dockerfile --tag containerscanner:${{ github.sha }}
18+
19+
- name: Anchore scan
20+
uses: anchore/scan-action@1.0.6
21+
with:
22+
image-reference: containerscanner:${{ github.sha }}
23+
dockerfile-path: Dockerfile
24+
include-app-packages: true
25+
fail-build: true # no idea why it doesn't work
26+
27+
- name: Show Anchore results
28+
run: for j in `ls ./anchore-reports/*.json`; do echo "---- ${j} ----"; cat ${j}; echo; done
29+
if: ${{ always() }}
30+
31+
- name: Upload Anchore results
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: anchore-reports
35+
path: ./anchore-reports/
36+
if: ${{ always() }}
37+
38+
- name: Fail on any vulnerability
39+
run: jq -e '.vulnerabilities | any( . ) | not' anchore-reports/vulnerabilities.json

0 commit comments

Comments
 (0)