-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef04370
commit b10f2bc
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: publish_docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
create: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish_docs: | ||
if: github.event_name == 'push' || (github.event_name == 'create' && github.event.ref_type == 'tag') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prepare branch name | ||
run: > | ||
echo "refName=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
- name: Checkout relevant branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.refName }} | ||
- name: Checkout gh-pages | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
path: target/gh-pages | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 17 | ||
- name: Run docs generation | ||
run: > | ||
./mvnw clean resources:copy-resources@prepare-asciidoc resources:copy-resources@copy-classes asciidoctor:process-asciidoc@generate-html-docs -pl docs && | ||
mv docs/target/generated-docs/index.html target/gh-pages/${refName}/ | ||
- name: Update index | ||
if: (github.event_name == 'create' && github.event.ref_type == 'tag') | ||
run: sed -e "s/\${current}/${refName}/g" ./etc/index.tpl > ./target/gh-pages/index.html | ||
- name: Commit to gh-pages | ||
working-directory: ./target/gh-pages | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update GH-Pages." | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
directory: target/gh-pages | ||
branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Redirecting...</title> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="refresh" content="0; URL=/neo4j-jdbc/${current}/" /> | ||
</head> | ||
<body> | ||
<p>Please follow <a href="/neo4j-jdbc/${current}/">this link</a>.</p> | ||
</body> | ||
</html> |