Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch docs deployment from Travis CI to GitHub Actions #563

Merged
merged 2 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/docs-prerequisites/action.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/actions/generate-publish-doc/action.yml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions .github/actions/generate-publish-doc/upload-script.sh
Original file line number Diff line number Diff line change
@@ -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://[email protected]/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
17 changes: 17 additions & 0 deletions .github/actions/setup-boost/action.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -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 }}