Build Website #1060
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Website | |
on: | |
schedule: | |
- cron: "30 1 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build Website | |
# runs-on: ubuntu-20.04 | |
runs-on: macos-latest | |
steps: | |
- name: Set up Go 1.20 | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
id: go | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: "0.81.0" | |
- 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 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 private 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 | |
- 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 --data @docs/searchindex.json | |
- name: Install AWS CLI | |
run: 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 |