7
7
- ' .github/workflows/**'
8
8
workflow_dispatch :
9
9
inputs :
10
- version :
11
- description : ' Version of library that is being documented'
10
+ dokka_artifact_url :
11
+ description : ' URL of Dokka artifact.'
12
+ required : true
13
+ dry_run :
14
+ type : boolean
15
+ description : " Dry run. If set to true, the action will not actually publish the pages, but will assemble the artifact."
16
+ default : true
12
17
required : true
13
18
14
19
permissions :
@@ -90,13 +95,21 @@ jobs:
90
95
run : unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}
91
96
92
97
- name : Download Dokka
93
- uses : actions/download-artifact@v4
94
- with :
95
- name : dokka-${{ inputs.version }}
96
- path : ${{ env.DOKKA_ARTIFACT }}
98
+ run : |
99
+ if [ -z "${{ inputs.dokka_artifact_url }}" ]; then
100
+ echo "'dokka_artifact_url' is not set"
101
+ exit 1
102
+ fi
103
+
104
+ curl -s -L ${{ inputs.dokka_artifact_url }} -o ${{ env.DOKKA_ARTIFACT }}
105
+
106
+ if [ -z "$(ls | grep -x ${{ env.DOKKA_ARTIFACT }})" ]; then
107
+ echo "Failed to download Dokka artifact: ${{ inputs.dokka_artifact_url }}"
108
+ exit 1
109
+ fi
97
110
98
111
- name : Unzip Dokka
99
- run : unzip -O UTF-8 -qq ' ${{ env.DOKKA_ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}/api
112
+ run : unzip ${{ env.DOKKA_ARTIFACT }} -d ${{ env.ASSEMBLE_DIR }}/api
100
113
101
114
- name : Update sitemap.xml
102
115
run : chmod +x updateSitemap.sh && ./updateSitemap.sh ${{ env.ASSEMBLE_DIR }}/sitemap.xml ${{ env.ASSEMBLE_DIR }}/api
@@ -110,7 +123,7 @@ jobs:
110
123
retention-days : 7
111
124
112
125
deploy :
113
- if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
126
+ if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && !inputs.dry_run
114
127
environment :
115
128
name : github-pages
116
129
url : ${{ steps.deployment.outputs.page_url }}
@@ -138,7 +151,7 @@ jobs:
138
151
uses : actions/deploy-pages@v4
139
152
140
153
publish-indexes :
141
- if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
154
+ if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && !inputs.dry_run
142
155
needs : [ build, test, assemble, deploy ]
143
156
runs-on : ubuntu-latest
144
157
container :
0 commit comments