diff --git a/.github/actions/docs-prerequisites/action.yml b/.github/actions/docs-prerequisites/action.yml new file mode 100644 index 0000000000..bc5a6a426c --- /dev/null +++ b/.github/actions/docs-prerequisites/action.yml @@ -0,0 +1,7 @@ +name: 'Get Docs Prerequisites' +description: 'Downloads all the necessary packages for building documentation' +runs: + using: composite + steps: + - run: sudo apt-get install doxygen python3 python3-pip python3-setuptools python3-sphinx + shell: bash diff --git a/.github/actions/generate-publish-doc/action.yml b/.github/actions/generate-publish-doc/action.yml new file mode 100644 index 0000000000..d794f43e59 --- /dev/null +++ b/.github/actions/generate-publish-doc/action.yml @@ -0,0 +1,17 @@ +name: 'Generate Doc' +description: 'Runs b2 on lib/gil/doc to generate documentation' +inputs: + github_token: + description: 'Github Token for Access' + required: true +runs: + using: composite + steps: + - run: | + echo "using doxygen ;" > ~/user-config.jam + cd ../boost-root/libs + ../b2 gil/doc + cd gil + chmod +x $GITHUB_WORKSPACE/.github/actions/generate-publish-doc/upload-script.sh + $GITHUB_WORKSPACE/.github/actions/generate-publish-doc/upload-script.sh ${{inputs.github_token}} + shell: bash diff --git a/.github/actions/generate-publish-doc/upload-script.sh b/.github/actions/generate-publish-doc/upload-script.sh new file mode 100644 index 0000000000..6883c198fc --- /dev/null +++ b/.github/actions/generate-publish-doc/upload-script.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e # Exit with Non Zero exit Code + +# Save some useful information +SHA=`git rev-parse --verify HEAD` + +mkdir temp-doc +cd temp-doc +git init + +git config user.name "Github Action Upload Docs" +git config user.email "Github Action Upload Docs" + +git remote add upstream "https://$1@github.com/boostorg/gil.git" + +git fetch upstream +git switch gh-pages + + +if [ "${GITHUB_REF##*/}" = develop ]; then + rm -r develop + mkdir -p develop/doc + cp ../index.html develop/ + cp ../doc/index.html develop/doc + cp -a ../doc/html develop/doc/ +else + rm index.html + rm -r html + cp ../doc/index.html . + cp -r ../doc/html . +fi + + +git add . + +# Commit the new version. +git commit -m "Deploy to GitHub Pages: ${SHA}" + +# Now that we're all set up, we can push. +git push -q upstream HEAD:gh-pages diff --git a/.github/actions/setup-boost/action.yml b/.github/actions/setup-boost/action.yml new file mode 100644 index 0000000000..89ba925f37 --- /dev/null +++ b/.github/actions/setup-boost/action.yml @@ -0,0 +1,17 @@ +name: 'Setup-Boost' +description: 'Downloads and sets up the necessary dependencies of Boost' +runs: + using: composite + steps: + - run: | + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/gil + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" gil + ./bootstrap.sh + ./b2 -d0 headers + shell: bash diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000000..376c42360b --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,17 @@ +name: Docs-Build +on: + push: + branches: + - master + - develop + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/docs-prerequisites + - uses: ./.github/actions/setup-boost + - uses: ./.github/actions/generate-publish-doc + with: + github_token: ${{ secrets.GIL_TEST_TOKEN }}