Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit 8eabb46

Browse files
Setup action for building the docs.
1 parent 3fe88fa commit 8eabb46

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/publish_docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: publish_docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
create:
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
publish_docs:
13+
if: github.event_name == 'push' || (github.event_name == 'create' && github.event.ref_type == 'tag')
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Prepare branch name
17+
run: >
18+
echo "::set-env name=refName::${GITHUB_REF##*/}"
19+
- name: Checkout relevant branch
20+
uses: actions/checkout@v2
21+
with:
22+
ref: ${{ env.refName }}
23+
- name: Checkout gh-pages
24+
uses: actions/checkout@v2
25+
with:
26+
ref: gh-pages
27+
path: target/gh-pages
28+
- name: Set up JDK
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 8
32+
- name: Run docs generation
33+
run: >
34+
./mvnw asciidoctor:process-asciidoc@generate-docs -pl org.neo4j.driver:neo4j-java-driver-spring-boot-starter-parent
35+
- name: Create symlink
36+
if: (github.event_name == 'create' && github.event.ref_type == 'tag')
37+
working-directory: ./target/gh-pages
38+
run: ln -sfn ${refName} current
39+
- name: Commit to gh-pages
40+
working-directory: ./target/gh-pages
41+
run: |
42+
git config --local user.email "action@github.com"
43+
git config --local user.name "GitHub Action"
44+
git add .
45+
git commit -m "Update GH-Pages."
46+
- name: Push changes
47+
uses: ad-m/github-push-action@v0.5.0
48+
with:
49+
directory: target/gh-pages
50+
branch: gh-pages
51+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)