-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch docs deployment from Travis CI to GitHub Actions (#563)
- Loading branch information
1 parent
f18445f
commit 0778069
Showing
5 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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://$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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |