-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.38 KB
/
ci-with-imagescan-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Image Scan - Demo pipeline
on: push
jobs:
lint-check:
name: lint-check
# we had issues with ubuntu, currently using MacOS
runs-on: ubuntu-latest
steps:
- name: Lint
run: echo "Your linting goes here..."
unit-tests:
name: unit-tests
runs-on: ubuntu-latest
steps:
- run: echo "Your Unit tests go here..."
format-check:
name: format-check
runs-on: ubuntu-latest
steps:
- name: format-check
run: echo "Your format checking goes here..."
build-and-scan-image:
name: build-and-scan-image
needs: [lint-check,unit-tests,format-check]
runs-on: ubuntu-latest
env:
IMAGE_NAME: base_infra:latest
PROJECT_KEY: default
CLI_VERSION: latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build Container Image
run: docker build -t ${IMAGE_NAME} .
- name: Orca Image Security Scan
id: run_orca_cli
env:
ORCA_SECURITY_API_TOKEN: ${{ secrets.ORCA_SECURITY_API_TOKEN }}
run: |
set +e
docker run -e ORCA_SECURITY_API_TOKEN --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/orcasecurity/orca-cli:${CLI_VERSION} -p ${PROJECT_KEY} image scan ${IMAGE_NAME}
push-to-registry:
name: push-to-registry
needs: [build-and-scan-image]
runs-on: ubuntu-latest
steps:
- run: echo "Pushing image to docker registry"