-
Notifications
You must be signed in to change notification settings - Fork 13
33 lines (29 loc) · 1.03 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Publish docs
on:
push:
branches:
- master
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build documentations
run: |
./gradlew installDist -Pinclude.documentation
- name: Commit documentation changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone https://github.com/gorpipe/gor.git --branch gh-pages --single-branch gh-pages
cp -r documentation/build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
# Commit fails if no changes are present. If it succeeds we set $GIT_PUSH to true,
# otherwise we just return true so the pipeline doesn't fail.
git commit -m "Update documentation" -a && GIT_PUSH=true || true
if [[ "$GIT_PUSH" = true ]]; then
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/gorpipe/gor.git" HEAD:gh-pages
fi