Skip to content

Commit

Permalink
fix gh workflow behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
oak committed Mar 3, 2022
1 parent 4a4736a commit 1419886
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 39 deletions.
40 changes: 1 addition & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,4 @@ jobs:
run: chmod +x mvnw

- name: Build with Maven
run: ./mvnw --no-transfer-progress --batch-mode compile

publish-docs-reports:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Export project version
run: echo "PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: Generate reports
run: ./mvnw --no-transfer-progress --batch-mode site

- name: Deploy maven reports to GitHub Pages as current version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: target/site
target-folder: docs/${{ env.PROJECT_VERSION }}/site

- name: Deploy maven reports to GitHub Pages as latest version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: target/site
target-folder: docs/latest/site
run: ./mvnw --no-transfer-progress --batch-mode test compile
45 changes: 45 additions & 0 deletions .github/workflows/gh-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update gh-pages

on:
workflow_run:
workflows: [ Java CI ]
types: [ completed ]

jobs:
publish-docs-reports:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Export project version
run: echo "PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: Generate reports
run: ./mvnw --no-transfer-progress --batch-mode site

- name: Deploy maven reports to GitHub Pages as current version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: target/site
target-folder: docs/${{ env.PROJECT_VERSION }}/site

- name: Deploy maven reports to GitHub Pages as latest version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: target/site
target-folder: docs/latest/site
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1419886

Please sign in to comment.