1
1
name : Build documentation
2
2
3
3
on :
4
- # If specified, the workflow will be triggered automatically once you push to the `main` branch.
5
- # Replace `main` with your branch’s name
6
- push :
7
- branches : ["main"]
4
+ # If specified, the workflow will be triggered automatically once you push to the `main` branch.
5
+ # Replace `main` with your branch’s name
6
+ push :
7
+ branches : ["main"]
8
+ # Specify to run a workflow manually from the Actions tab on GitHub
9
+ workflow_dispatch :
8
10
9
- # Specify to run a workflow manually from the Actions tab on GitHub
10
- workflow_dispatch :
11
+ # Gives the workflow permissions to clone the repo and create a page deployment
12
+ permissions :
13
+ id-token : write
14
+ pages : write
11
15
12
16
env :
13
- # Name of module and id separated by a slash
14
- INSTANCE : Writerside/hi
15
- # Replace HI with the ID of the instance in capital letters
16
- ARTIFACT : webHelpHI2-all.zip
17
- # Writerside docker image version
18
- DOCKER_VERSION : 232.10275
19
- # Add the variable below to upload Algolia indexes
20
- # Replace HI with the ID of the instance in capital letters
21
- ALGOLIA_ARTIFACT : algolia-indexes-HI.zip
17
+ # Name of module and id separated by a slash
18
+ INSTANCE : Writerside/hi
19
+ # Replace HI with the ID of the instance in capital letters
20
+ ARTIFACT : webHelpHI2-all.zip
21
+ # Writerside docker image version
22
+ DOCKER_VERSION : 232.10275
23
+ # Add the variable below to upload Algolia indexes
24
+ # Replace HI with the ID of the instance in capital letters
25
+ ALGOLIA_ARTIFACT : algolia-indexes-HI.zip
22
26
23
27
jobs :
24
- build :
25
- runs-on : ubuntu-latest
26
- steps :
27
- - name : Checkout repository
28
- uses : actions/checkout@v3
29
-
30
- - name : Build Writerside docs using Docker
31
- uses : JetBrains/writerside-github-action@v4
32
- with :
33
- instance : ${{ env.INSTANCE }}
34
- artifact : ${{ env.ARTIFACT }}
35
- docker-version : ${{ env.DOCKER_VERSION }}
36
-
37
- - name : Upload documentation
38
- uses : actions/upload-artifact@v3
39
- with :
40
- name : docs
41
- path : |
42
- artifacts/${{ env.ARTIFACT }}
43
- artifacts/report.json
44
- retention-days : 7
45
-
46
- # Add the step below to upload Algolia indexes
47
- - name : Upload algolia-indexes
48
- uses : actions/upload-artifact@v3
49
- with :
50
- name : algolia-indexes
51
- path : artifacts/${{ env.ALGOLIA_ARTIFACT }}
52
- retention-days : 7
53
-
54
- # Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors
55
- test :
28
+ build :
29
+ runs-on : ubuntu-latest
30
+
31
+ steps :
32
+ - name : Checkout repository
33
+ uses : actions/checkout@v3
34
+
35
+ - name : Build Writerside docs using Docker
36
+ uses : JetBrains/writerside-github-action@v4
37
+ with :
38
+ instance : ${{ env.INSTANCE }}
39
+ artifact : ${{ env.ARTIFACT }}
40
+ docker-version : ${{ env.DOCKER_VERSION }}
41
+
42
+ - name : Upload documentation
43
+ uses : actions/upload-artifact@v3
44
+ with :
45
+ name : docs
46
+ path : |
47
+ artifacts/${{ env.ARTIFACT }}
48
+ artifacts/report.json
49
+ retention-days : 7
50
+
51
+ # Add the step below to upload Algolia indexes
52
+ - name : Upload algolia-indexes
53
+ uses : actions/upload-artifact@v3
54
+ with :
55
+ name : algolia-indexes
56
+ path : artifacts/${{ env.ALGOLIA_ARTIFACT }}
57
+ retention-days : 7
58
+
59
+ # Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors
60
+ test :
56
61
# Requires build job results
57
- needs : build
58
- runs-on : ubuntu-latest
59
-
60
- steps :
61
- - name : Download artifacts
62
- uses : actions/download-artifact@v1
63
- with :
64
- name : docs
65
- path : artifacts
66
-
67
- - name : Test documentation
68
- uses : JetBrains/writerside-checker-action@v1
69
- with :
70
- instance : ${{ env.INSTANCE }}
62
+ needs : build
63
+ runs-on : ubuntu-latest
64
+
65
+ steps :
66
+ - name : Download artifacts
67
+ uses : actions/download-artifact@v1
68
+ with :
69
+ name : docs
70
+ path : artifacts
71
+
72
+ - name : Test documentation
73
+ uses : JetBrains/writerside-checker-action@v1
74
+ with :
75
+ instance : ${{ env.INSTANCE }}
76
+
77
+ deploy :
78
+ environment :
79
+ name : github-pages
80
+ url : ${{ steps.deployment.outputs.page_url }}
81
+ # Requires the build job results
82
+ needs : test
83
+ runs-on : ubuntu-latest
84
+ steps :
85
+ - name : Download artifact
86
+ uses : actions/download-artifact@v3
87
+ with :
88
+ name : docs
89
+
90
+ - name : Unzip artifact
91
+ run : unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir
92
+
93
+ - name : Setup Pages
94
+ uses : actions/configure-pages@v2
95
+
96
+ - name : Upload artifact
97
+ uses : actions/upload-pages-artifact@v1
98
+ with :
99
+ path : dir
100
+
101
+ - name : Deploy to GitHub Pages
102
+ id : deployment
103
+ uses : actions/deploy-pages@v1
0 commit comments