-
Notifications
You must be signed in to change notification settings - Fork 32
75 lines (61 loc) · 2.2 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
name: Release Workflow
on:
workflow_dispatch:
jobs:
release:
name: Build and Sign
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build JAR
run: mvn clean install -Dskiptests=true
- name: Create container
run: docker build -t jscott932/app-java-demo:latest .
- name: Get Image Digest to Sign
run: |
IMAGE_SHA=$(docker inspect jscott932/app-java-demo:latest | jq -r '.[].Id')
IMAGE_NAME=jscott932/app-java-demo
SIGNING_TARGET="$IMAGE_NAME"@"$IMAGE_SHA"
echo ARTIFACT="$SIGNING_TARGET" >> $GITHUB_ENV
- name: Container Sign
uses: endorlabs/github-action/sign@736c93ea52b002f2ac229aaeb273b102cbf6fe12
with:
namespace: "yolo"
artifact_name: ${{ env.ARTIFACT }}
- name: Run Tests
run: |
mvn test
- name: Endor Labs Dependency Scan
uses: endorlabs/github-action@v1.1.2
with:
namespace: "yolo"
scan_summary_output_type: "table"
pr: "false"
enable_github_action_token: "true"
scan_dependencies: "true"
scan_secrets: "true"
scan_git_logs: "true"
- name: Run SAST
run: python3 -m pip install semgrep && semgrep scan
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Image Digest to Verify
run: |
VERIFY_SHA=$(docker inspect jscott932/app-java-demo:latest | jq -r '.[].Id')
VERIFY_IMAGE_NAME=jscott932/app-java-demo
VERIFY_TARGET="$VERIFY_IMAGE_NAME"@"$VERIFY_SHA"
echo VERIFY_ARTIFACT="$VERIFY_TARGET" >> $GITHUB_ENV
- name: Container verify
uses: endorlabs/github-action/verify@736c93ea52b002f2ac229aaeb273b102cbf6fe12
with:
namespace: "yolo"
artifact_name: ${{ env.VERIFY_ARTIFACT }}
- name: Push to Docker Hub
run: docker push jscott932/app-java-demo:latest