-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PRIS-119: automatically publish master branch docs to github pages
- Loading branch information
Benjamin Reed
committed
Jul 10, 2023
1 parent
0f6d6c5
commit 91fae87
Showing
1 changed file
with
50 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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
branch-management: opennms/[email protected] | ||
|
||
executors: | ||
docker-executor: | ||
docker: | ||
|
@@ -13,6 +16,9 @@ executors: | |
go-executor: | ||
docker: | ||
- image: circleci/golang | ||
simple-executor: | ||
docker: | ||
- image: cimg/base:current | ||
|
||
commands: | ||
dockerhub-login: | ||
|
@@ -26,7 +32,10 @@ commands: | |
workflows: | ||
build: | ||
jobs: | ||
- build | ||
- build: | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
- generate-docs: | ||
requires: | ||
- build | ||
|
@@ -57,6 +66,15 @@ workflows: | |
- /^release-.*/ | ||
requires: | ||
- smoke-tests | ||
- publish-javadoc: | ||
context: | ||
- "github-releases" | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
requires: | ||
- smoke-tests | ||
|
||
jobs: | ||
build: | ||
|
@@ -252,3 +270,34 @@ jobs: | |
cp opennms-pris-dist/target/opennms-pris-release-archive.tar.gz github-latest/opennms-pris-release-$(cat version.txt).tar.gz | ||
cp opennms-pris-dist/target/opennms-pris-release-archive.zip github-latest/opennms-pris-release-$(cat version.txt).zip | ||
ghr -r ${CIRCLE_PROJECT_REPONAME} $(cat version.txt) github-latest | ||
publish-javadoc: | ||
executor: simple-executor | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "80:24:47:19:df:7b:f3:bf:8a:4d:45:c1:89:88:29:4c" | ||
- run: | ||
name: clone gh-pages branch | ||
command: | | ||
cd ~/project | ||
install -d -m 700 ~/.ssh | ||
curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts | ||
git clone --filter=tree:0 --branch gh-pages [email protected]:OpenNMS/opennms-provisioning-integration-server gh-pages | ||
- run: | ||
name: publish updated javadocs | ||
command: | | ||
cd ~/project/gh-pages | ||
rm -rf * | ||
unzip ../target/*-javadoc.jar | ||
git add -A . | ||
git config user.email "[email protected]" | ||
git config user.name "CI/CD System" | ||
git commit -m 'publish latest API docs' | ||
- run: | ||
name: push to gh-pages | ||
command: | | ||
cd ~/project/gh-pages | ||
git push --no-verify origin gh-pages:gh-pages |