forked from softprops/lambda-rust
-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (64 loc) · 1.77 KB
/
main.yml
File metadata and controls
66 lines (64 loc) · 1.77 KB
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
name: Main
on:
push:
branches:
- master
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Build
env:
REPO: ${{ github.repository }}
shell: bash
run: |
echo "docker_repo=${{ env.REPO }}" >> $GITHUB_ENV
make build && make build-arm64
- name: Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.0.20
with:
image-ref: '${{ env.docker_repo }}:latest'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Trivy vulnerability scanner on arm64 image
uses: aquasecurity/trivy-action@0.0.20
with:
image-ref: '${{ env.docker_repo }}:latest-arm64'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Build
shell: bash
run: make build && make build-arm64
- name: Test
run: make test
publish:
needs: [scan, test]
if: github.repository == 'rust-serverless/lambda-rust'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Build
shell: bash
run: make build && make build-arm64
- name: Publish Latest
shell: bash
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
make publish && make publish-arm64