Skip to content

Commit

Permalink
feature/IVYPORTAL-18151-Create-Github-Action-for-Building-Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ntloc-axonivy committed Dec 26, 2024
1 parent 556058b commit 026e410
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/portal-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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)

0 comments on commit 026e410

Please sign in to comment.