-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (100 loc) · 2.68 KB
/
main.yaml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: samuel nwoye website pipeline
on:
push:
branches: [ main ]
env:
HUGO_VERSION: 0.111.3
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: static code analysis
uses: aquasecurity/trivy-action@master
with:
scan-type: 'config'
scan-ref: 'terraform'
format: table
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM'
- name: repository analysis
uses: aquasecurity/trivy-action@master
with:
scan-type: 'repo'
scan-ref: 'https://github.com/knoxknot/knoxknot.github.io'
format: table
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM'
- name: filesystem analysis
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: table
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: sbom analysis
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
image-ref: '.'
format: 'github'
output: 'dependency-results.sbom.json'
github-pat: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '${{ env.HUGO_VERSION }}'
extended: true
- name: setup pages
id: pages
uses: actions/configure-pages@v3
- name: build with hugo
run: hugo --gc --minify --baseURL "${{ steps.pages.output.base_url}}"
env:
HUGO_ENVIRONMENT: production
TZ: 'Africa/Lagos'
- name: upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
deploy:
runs-on: ubuntu-latest
needs:
- test
- build
permissions:
pages: write
id-token: write
if: contains(github.ref, 'main')
steps:
- name: checkout and filter
uses: actions/checkout@v3
# - name: filter directories
# uses: dorny/paths-filter@v2
# id: filter
# with:
# filters: |
# terraform:
# - 'terraform/**'
# - names: deploy dns to namecheap
# if: steps.filter.outputs.terraform == 'true'
# uses: dflook/terraform-apply@v1
- name: deploy to github pages
id: deployment
uses: actions/deploy-pages@v2
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url}}