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

docs: Updated GA workflow to publish with peaceiris/action-gh-pages #574

Merged
merged 1 commit into from
Mar 10, 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
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'