This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
generated from homecentr/docker-template
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.48 KB
/
ci.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
name: CI PR/Branch
on:
push:
branches-ignore:
- master
pull_request:
env:
IMAGE_NAME: "homecentr/mkdocs-material"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up java for tests execution
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set tag var
id: vars
run: echo ::set-output name=docker_tag::$(echo ${GITHUB_REF} | cut -d'/' -f3)-${GITHUB_SHA}
- name: Verify Dockerfile with Hadolint
uses: brpaz/hadolint-action@master
- name: Build Docker image
run: docker build . -t ${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.docker_tag }}
- name: Test Docker image
run: cd tests && sudo gradle test --info -Dimage_tag=${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.docker_tag }}
- name: Scan with Phonito Security
uses: phonito/phonito-scanner-action@master
with:
image: ${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.docker_tag }}
fail-level: 'HIGH'
phonito-token: '${{ secrets.PHONITO_TOKEN }}'
- name: Scan with Snyk
uses: snyk/actions/[email protected]
continue-on-error: true # Errors ignored, the image contains high severity issue which does not have a fix yet
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: ${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.docker_tag }}
args: --severity-threshold=high