-
Notifications
You must be signed in to change notification settings - Fork 71
96 lines (85 loc) · 2.29 KB
/
release.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
env:
GO_VERSION: "1.18"
jobs:
tests:
name: Run Tests
runs-on: ubuntu-20.04
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build
run: make build
- name: Run Unit tests
run: |
make test
- name: Run Integration Tests
run: make test-integration
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
severity: 'CRITICAL'
exit-code: 0
- name: Run Trivy vulnerability scanner against Aqua Cloud
uses: aquasecurity/[email protected]
with:
scan-type: 'fs'
hide-progress: true
format: 'table'
security-checks: 'vuln,config'
env:
AQUA_KEY: ${{ secrets.AQUA_KEY }}
AQUA_SECRET: ${{ secrets.AQUA_SECRET }}
TRIVY_RUN_AS_PLUGIN: 'aqua'
release:
name: Release
needs:
- tests
runs-on: ubuntu-20.04
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v2
with:
registry: public.ecr.aws
username: ${{ secrets.ECR_ACCESS_KEY_ID }}
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
- name: Release
uses: goreleaser/goreleaser-action@v4
with:
version: ~> 0.180
args: release --rm-dist
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log out from docker.io and ECR registries
if: ${{ always() }}
run: |
docker logout docker.io
docker logout public.ecr.aws