-
Notifications
You must be signed in to change notification settings - Fork 16
165 lines (138 loc) · 5.25 KB
/
cron.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build Website
on:
schedule:
- cron: "0 1,13 * * *"
workflow_dispatch:
jobs:
build:
name: Build Website
runs-on: ubuntu-22.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 32768 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
remove-android: "true"
remove-docker-images: "true"
remove-dotnet: "true"
remove-haskell: "true"
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'
id: go
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.126.1"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Create build folder
run: mkdir avd-repo
- name: Checkout public vuln-list-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/vuln-list
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/vuln-list
- name: Checkout public vuln-list-nvd-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/vuln-list-nvd
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/vuln-list-nvd
- name: Checkout public vuln-list-redhat-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/vuln-list-redhat
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/vuln-list-redhat
- name: Checkout public kube-hunter-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/kube-hunter
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/kube-hunter-repo
- name: Checkout public cloud-security-remediation-guides-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/cloud-security-remediation-guides
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/remediations-repo
- name: Checkout public tracee-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/tracee
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/tracee-repo
- name: Checkout public cloudsploit-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/cloudsploit
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/cloudsploit-repo
- name: Checkout public trivy-policies-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/trivy-policies
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/trivy-policies-repo
- name: Checkout public kube-bench-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/kube-bench
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/kube-bench-repo
- name: Checkout public chain-bench-repo
uses: actions/checkout@v3
with:
repository: aquasecurity/chain-bench
token: ${{ secrets.ORG_REPO_TOKEN }}
path: avd-repo/chain-bench-repo
- name: Build generator
run: make md-clean md-build
- name: Sync avd-repo with latest changes from generator
run: make sync-all
- name: Build and Generate Markdown pages
run: make md-generate
## We have already created *.md files, so we can remove the repositories to save free space.
- name: Remove repositories
run: make remove-all-repos
- name: Generate Hugo website
run: make hugo-generate
- name: Copy assets
run: make copy-assets
- name: Deploy Search Index to MeiliSearch Instance
run: |
cd avd-repo
curl -H 'Content-Type: application/json' -H 'X-Meili-API-Key: ${{ secrets.SEARCHAPITOKEN }}' -X POST ${{ secrets.SEARCHAPIHOST }}/indexes/avd/documents?primaryKey=title --data @docs/searchindex.json
- name: Install AWS CLI
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install awscli
- name: Sync changes to the bucket
run: aws s3 sync --no-progress --only-show-errors --size-only avd-repo/docs ${{ secrets.PROD_AVD_BUCKET }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AVD_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AVD_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
- name: Microsoft Teams Notification
## Until the PR with the fix for the AdaptivCard version is merged yet
## https://github.com/Skitionek/notify-microsoft-teams/pull/96
## Use the aquasecurity fork
uses: aquasecurity/notify-microsoft-teams@master
if: failure()
with:
webhook_url: ${{ secrets.TRIVY_MSTEAMS_WEBHOOK }}
needs: ${{ toJson(needs) }}
job: ${{ toJson(job) }}
steps: ${{ toJson(steps) }}
keepalive-job: # needed to keep GitHub from disabling the actions due to inactivity
name: Keepalive Workflow
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: gautamkrishnar/keepalive-workflow@v2