-
Notifications
You must be signed in to change notification settings - Fork 41
48 lines (42 loc) · 1.17 KB
/
docker-hub.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
name: Docker Hub
on:
workflow_dispatch:
push:
branches: [ main ]
tags: [ '*' ]
jobs:
hadolint:
runs-on: ubuntu-20.04
name: "Hadolint"
steps:
- uses: actions/checkout@v3
- uses: hadolint/[email protected]
with:
dockerfile: "./Dockerfile"
publish:
needs: hadolint
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and publish
run: |
# If it is a tag:
if [ -z "${GITHUB_REF##refs/tags/*}" ] ; then
./scripts/docker-hub-publish.sh ${GITHUB_REF#refs/tags/}
else
./scripts/docker-hub-publish.sh ${GITHUB_SHA}
fi
- name: Trivy Scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'zeitgeistpm/zeitgeist-node:latest'
format: 'sarif'
output: 'zetgeist-node-report.sarif'
severity: 'HIGH,CRITICAL'