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 + 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 + 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 + 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 "" >> 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.