diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml
new file mode 100644
index 000000000000..9bb6ebe5b987
--- /dev/null
+++ b/.github/workflows/gh-pages.yaml
@@ -0,0 +1,118 @@
+name: Github Pages
+on:
+ push:
+ branches: [ 'master' ]
+jobs:
+ publish:
+ name: Publish stats, tables and guides
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Install Deps
+ uses: mstksg/get-package@master
+ with:
+ apt-get: cmake ninja-build libopenscap8 libxml2-utils expat xsltproc python3-jinja2 python3-yaml python3-setuptools ansible-lint python3-github bats python3-pytest python3-pytest-cov python3-pip
+ - name: Install deps python
+ run: pip3 install json2html
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Build
+ run: cmake .. -G Ninja
+ working-directory: ./build
+ - name: Build page
+ run: ninja rhel8
+ working-directory: ./build
+ - name: Build page
+ run: ninja rhel8-html-stats rhel8-html-profile-stats -j2
+ working-directory: ./build
+ - name: Generate HTML pages
+ run: |-
+ PAGES_DIR=__pages
+ mkdir $PAGES_DIR
+ STATS_DIR=$PAGES_DIR/statistics
+ mkdir $STATS_DIR
+ touch $STATS_DIR/index.html
+ echo "" > $STATS_DIR/index.html
+ echo "
" >> $STATS_DIR/index.html
+ echo "" >> $STATS_DIR/index.html
+ # get supported products
+ products=$(echo -e "import ssg.constants\nprint(ssg.constants.product_directories)" | python | sed -s "s/'//g; s/,//g; s/\[//g; s/\]//g")
+ echo "Supported products: $products"
+ for product in $products
+ do
+ if [ -d build/$product ]; then
+ mkdir -p $STATS_DIR/$product
+ if [ -f build/$product/product-statistics/statistics.html ]; then
+ cp -rf build/$product/product-statistics $STATS_DIR/$product/product-statistics
+ echo "- Statistics for product: ${product}
" >> $STATS_DIR/index.html
+ fi
+ if [ -f build/$product/profile-statistics/statistics.html ]; then
+ cp -rf build/$product/profile-statistics $STATS_DIR/$product/profile-statistics
+ echo "- Profile statistics for product: ${product}
" >> $STATS_DIR/index.html
+ fi
+ fi
+ done
+ echo "
" >> $STATS_DIR/index.html
+ echo "" >> $STATS_DIR/index.html
+ echo "" >> $STATS_DIR/index.html
+
+
+ pushd build/guides
+ touch index.html
+ echo "" > index.html
+ echo "" >> index.html
+ echo "Right Click to save the guide and open it locally
" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ for guide in ssg-*.html
+ do
+ echo "- ${guide}
" >> index.html
+ done
+ echo "
" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ popd
+
+ cp -rf build/guides $PAGES_DIR
+
+
+ pushd build/tables
+ touch index.html
+ echo "" > index.html
+ echo "" >> index.html
+ echo "Right Click to save the table and open it locally
" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ for table in table-*.html
+ do
+ echo " " >> index.html
+ done
+ echo "
" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ popd
+
+ pushd $PAGES_DIR
+ touch index.html
+ echo "" > index.html
+ echo "" >> index.html
+ echo "Available Artifacts
" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ echo "- Statistics
" >> index.html
+ echo "- Guides
" >> index.html
+ echo "- Tables
" >> index.html
+ echo "
" >> index.html
+ echo "" >> index.html
+ echo "" >> index.html
+ popd
+
+ cp -rf build/tables $PAGES_DIR
+
+ - name: Deploy
+ uses: JamesIves/github-pages-deploy-action@v4.2.3
+ with:
+ branch: gh-pages # The branch the action should deploy to.
+ folder: __pages # The folder the action should deploy.