-
Notifications
You must be signed in to change notification settings - Fork 3
134 lines (118 loc) Β· 5.29 KB
/
portal-documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Portal Documentation
run-name: Build and Deploy Documentation π
on:
workflow_dispatch:
inputs:
ivyVersion:
description: 'Ivy version use to replace |version| placeholder of the links which navigate to ivy documentation. e.g.: https://developer.axonivy.com/doc/nightly/designer-guide/configuration/variables.html'
default: 'nightly'
required: true
push:
branches:
- 'feature/IVYPORTAL-18151-Create-Github-Action-for-Building-Documentation'
jobs:
prepare-document:
runs-on: portal-01
outputs:
documentVersion: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.8
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get current version
id: get_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout -f Documentation/pom.xml)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
if [[ "$VERSION" == "null object or invalid expression" ]]; then
echo "Error: could not evaluate maven revision property"
exit 1
fi
echo "Version is $VERSION" && echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- 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: Build HTML documentation
# uses: docker://axonivy/build-container:read-the-docs-2
# with:
# args: make -C /doc-build html BASEDIR=${{ github.workspace }}/Documentation/portal-guide VERSION=${{ steps.get_version.outputs.version }}
- name: Build Documentation HTML
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace/Documentation/portal-guide \
axonivy/build-container:read-the-docs-2 make html BASEDIR='/workspace/Documentation/portal-guide' VERSION=${{ steps.get_version.outputs.version }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: |
Documentation/*/build/html/**/*
Documentation/*/target/*.zip
# build-document:
# runs-on: portal-01
# needs: prepare-document
# steps:
# - name: Build HTML documentation with Read the Docs
# container:
# image: axonivy/build-container:read-the-docs-2
# env:
# BASEDIR: ${{ github.workspace }}/Documentation/portal-guide
# VERSION: ${{ needs.prepare-document.outputs.documentVersion }}
# run: make -C /doc-build html
# uses: docker://axonivy/build-container:read-the-docs-2
# with:
# entrypoint: "make"
# env:
# BASEDIR: ${{ github.workspace }}/Documentation/portal-guide
# VERSION: ${{ needs.prepare-document.outputs.documentVersion }}
# args: ["-C", "/doc-build", "html"]
# - name: Cleanup
# shell: bash
# run: |
# rm -r --force ${{ github.workspace }}\*
# unzip-screenshot:
# runs-on: portal-01
# needs: get-current-version
# steps:
# - name: Unzip portal screenshots
# run: |
# unzip /mnt/portal02/document-screenshots/portal-document-screenshots-selenide-${{ needs.get-current-version.outputs.documentVersion }}.zip \
# -d Documentation/portal-guide/source/screenshots
# test-another-job:
# runs-on: portal-01
# needs: get-current-version
# container:
# image: axonivy/build-container:read-the-docs-2
# steps:
# - name: test-1
# run: echo ${{ needs.get-current-version.outputs.documentVersion }}
# - run: echo "π The job was manually triggered by a ${{ inputs.ivyVersion }} event."
# - run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!"
# - run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
# - name: Check out repository code
# uses: actions/checkout@v4
# - run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner."
# - run: echo "π₯οΈ The workflow is now ready to test your code on the runner."
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
# - run: echo "π This job's status is ${{ job.status }}."