Skip to content

Commit

Permalink
docs: Updated GA workflow to publish with peaceiris/action-gh-pages (b…
Browse files Browse the repository at this point in the history
  • Loading branch information
gopi487krishna authored and meshtag committed Apr 21, 2021
1 parent c6c19a0 commit 5374554
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
13 changes: 13 additions & 0 deletions .github/actions/generate-doc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Generate Doc'
description: 'Runs b2 on lib/gil/doc to generate documentation'
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-doc/docs-config.sh
$GITHUB_WORKSPACE/.github/actions/generate-doc/docs-config.sh
shell: bash
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
#!/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 remote add upstream "https://github.com/boostorg/gil.git"

git fetch upstream
git switch gh-pages


if [ "${GITHUB_REF##*/}" = develop ]; then
# Only updates develop directory and keeps others intact
rm -r develop
mkdir -p develop/doc
cp ../index.html develop/
cp ../doc/index.html develop/doc
cp -a ../doc/html develop/doc/
else
# main branch
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
# Remove version control
rm -rf .git
17 changes: 0 additions & 17 deletions .github/actions/generate-publish-doc/action.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/docs-prerequisites
- uses: ./.github/actions/setup-boost
- uses: ./.github/actions/generate-publish-doc
- uses: ./.github/actions/generate-doc
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ../boost-root/libs/gil/temp-doc
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

0 comments on commit 5374554

Please sign in to comment.