From 026e41090586583f34b03205d5a9f1b26e8657d9 Mon Sep 17 00:00:00 2001 From: Loc Nguyen Date: Thu, 26 Dec 2024 11:34:02 +0700 Subject: [PATCH] feature/IVYPORTAL-18151-Create-Github-Action-for-Building-Documentation --- .github/workflows/portal-documentation.yaml | 40 ++++++++++----------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/portal-documentation.yaml b/.github/workflows/portal-documentation.yaml index d41690eee6..0a19dbd806 100644 --- a/.github/workflows/portal-documentation.yaml +++ b/.github/workflows/portal-documentation.yaml @@ -57,27 +57,38 @@ jobs: echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "Version is $VERSION" - # - name: Unzip portal screenshots - # run: | - # unzip /mnt/portal02/document-screenshots/portal-document-screenshots-selenide-${{ steps.get_version.outputs.version }}.zip \ - # -d Documentation/portal-guide/source/screenshots + - name: Unzip portal screenshots + run: | + unzip /mnt/portal02/document-screenshots/portal-document-screenshots-selenide-${{ steps.get_version.outputs.version }}.zip \ + -d Documentation/portal-guide/source/screenshots - name: Generate resources run: | mvn clean process-resources -Divy.engine.version=[13.1.0,] -Divy.engine.download.url=https://developer.axonivy.com/permalink/dev/axonivy-engine.zip -f Documentation/public-api/pom.xml mvn clean generate-resources -f Documentation/pom.xml - - name: Run substitute - shell: bash - run: chmod +x Documentation/portal-guide/substitute.sh && Documentation/portal-guide/substitute.sh ${{ inputs.ivyVersion }} + # - name: Run substitute + # shell: bash + # run: chmod +x Documentation/portal-guide/substitute.sh && Documentation/portal-guide/substitute.sh ${{ inputs.ivyVersion }} - name: Build Documentation HTML run: | docker run -u root:root --rm -v ${{ github.workspace }}:/workspace -w /workspace/Documentation/portal-guide \ - axonivy/build-container:read-the-docs-2 make -C /doc-build html BASEDIR='/workspace/Documentation/portal-guide' VERSION=${{ steps.get_version.outputs.version }} > sphinx-warnings.log || true + axonivy/build-container:read-the-docs-2 make -C /doc-build html BASEDIR='/workspace/Documentation/portal-guide' VERSION=${{ steps.get_version.outputs.version }} 2> sphinx-warnings.log || true WARNINGS=$(grep -c "WARNING" sphinx-warnings.log || echo 0) echo "locne" echo "Found $WARNINGS warnings." + if [ "$WARNINGS" -ge 1 ]; then + echo "Documentation build has warnings. Adding to summary..." + echo "### Documentation Build Warnings" >> $GITHUB_STEP_SUMMARY + echo "Found $WARNINGS warnings during the documentation build." >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "#### Warning Details" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat sphinx-warnings.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + fi + # - name: Install or deploy document # run: | @@ -100,17 +111,4 @@ jobs: - name: Cleanup shell: bash run: rm -rf ${{ github.workspace }}/* - - test-deploy: - runs-on: portal-01 - container: - image: axonivy/build-container:read-the-docs-2 - env: - NODE_ENV: development - volumes: - - ${{ github.workspace }}:/workspace - options: --rm -w /workspace/Documentation/portal-guide - steps: - - name: Check for dockerenv file - run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) \ No newline at end of file