Skip to content

Commit 45e0b90

Browse files
author
Vladimir Kotal
committed
use checkout action
1 parent 1676257 commit 45e0b90

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/javadoc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
path: ~/.m2
2929
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3030
restore-keys: ${{ runner.os }}-m2
31+
- name: Checkout gh-pages branch
32+
uses: actions/checkout@v2
33+
with:
34+
ref: gh-pages
35+
path: gh-pages
3136
- name: Refresh Javadoc
3237
env:
3338
OPENGROK_REPO_SLUG: ${{ github.repository }}

dev/javadoc.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
set -e
44
set -x
55

6+
if [[ -z "$OPENGROK_BUILD_DIR" ]]; then
7+
echo -e "empty OPENGROK_BUILD_DIR"
8+
exit 1
9+
fi
10+
611
if [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/heads/* ]]; then
712
OPENGROK_BRANCH=${OPENGROK_REF#"refs/heads/"}
813
fi
@@ -22,14 +27,12 @@ echo -e "Building Javadoc...\n"
2227
echo -e "Publishing javadoc to $BRANCH...\n"
2328
git config --global user.name "github-actions[bot]"
2429
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
25-
git clone --quiet --branch=$BRANCH \
26-
https://github.com/oracle/opengrok "$BRANCH"
2730

2831
cd "$BRANCH"
2932
if [[ -d ./javadoc ]]; then
3033
git rm -rf ./javadoc
3134
fi
32-
cp -Rf ${OPENGROK_BUILD_DIR}/target/site/apidocs ./javadoc
35+
cp -Rf "$OPENGROK_BUILD_DIR/target/site/apidocs" ./javadoc
3336
git add -f ./javadoc
3437
git commit -m "Lastest javadoc auto-pushed to branch $BRANCH"
3538
git push -fq origin "$BRANCH"

0 commit comments

Comments
 (0)