-
Notifications
You must be signed in to change notification settings - Fork 700
65 lines (65 loc) · 2.49 KB
/
gh-pages.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
name: Github Pages
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
merge_group:
branches: [ 'master' ]
jobs:
publish:
name: Publish stats, tables and guides
runs-on: ubuntu-latest
container:
image: fedora:latest
env:
PAGES_DIR: __pages
steps:
- name: Install Deps
run: dnf install -y cmake git ninja-build openscap-utils python3-pyyaml python3-jinja2 python3-pytest ansible-lint libxslt python3-pip rsync python3-lxml
- name: Install deps python
run: pip3 install json2html prometheus_client
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug
working-directory: ./build
- name: Build Guides and Mapping Tables
run: ninja -j2
working-directory: ./build
- name: Build Statistics
run: ninja html-stats html-profile-stats -j2
working-directory: ./build
- name: Render Policies (Using control files)
run: ninja render-policies -j2
working-directory: ./build
- name: Generate Prometheus Metrics
run: utils/controleval_metrics.py prometheus -p fedora ocp4 rhcos4 rhel9 rhel8 rhel7 sle12 sle15 -f ./build/policies_metrics
env:
PYTHONPATH: ${{ github.workspace }}
- name: Generate HTML pages
run: utils/generate_html_pages.sh $PAGES_DIR
shell: bash
env:
PYTHONPATH: ${{ github.workspace }}
- name: Configure git to trust the workspace despite the different owner
run:
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Deploy
if: ${{ github.event_name == 'push' && github.repository == 'ComplianceAsCode/content' && github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: main # The branch the action should deploy to.
folder: ${{ env.PAGES_DIR }} # The folder the action should deploy.
clean-exclude: srg_mapping/*
repository-name: ComplianceAsCode/content-pages
single-commit: true
token: ${{ secrets.CONTENT_PAGES_TOKEN }}
git-config-name: openscap-ci
git-config-email: openscap-ci@gmail.com
- name: Upload artifact if the event is pull request
uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: built-content
path: ${{ env.PAGES_DIR }}