From 1419886baa5026743f22d7869e5ffe273fb697ba Mon Sep 17 00:00:00 2001 From: Alexandre C Date: Thu, 3 Mar 2022 15:59:29 -0300 Subject: [PATCH] fix gh workflow behavior --- .github/workflows/build.yml | 40 +------------------------------ .github/workflows/gh-docs.yml | 45 +++++++++++++++++++++++++++++++++++ .idea/misc.xml | 3 +++ .idea/vcs.xml | 6 +++++ 4 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/gh-docs.yml create mode 100644 .idea/vcs.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7d7b2e8..b657673a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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/github-pages-deploy-action@v4.2.2 - 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/github-pages-deploy-action@v4.2.2 - with: - branch: gh-pages - clean: true - folder: target/site - target-folder: docs/latest/site \ No newline at end of file + run: ./mvnw --no-transfer-progress --batch-mode test compile diff --git a/.github/workflows/gh-docs.yml b/.github/workflows/gh-docs.yml new file mode 100644 index 00000000..ecb84027 --- /dev/null +++ b/.github/workflows/gh-docs.yml @@ -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/github-pages-deploy-action@v4.2.2 + 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/github-pages-deploy-action@v4.2.2 + with: + branch: gh-pages + clean: true + folder: target/site + target-folder: docs/latest/site \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 708f30e7..747f24ce 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,4 +8,7 @@ + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file