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 : ' If set to true, the action will not actually publish the pages, but will assemble the artifact. Default is false.'
12
16
required : true
13
17
14
18
permissions :
@@ -90,10 +94,21 @@ jobs:
90
94
run : unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}
91
95
92
96
- name : Download Dokka
93
- uses : actions/download-artifact@v4
94
- with :
95
- name : dokka-${{ inputs.version }}
96
- path : ${{ env.DOKKA_ARTIFACT }}
97
+ run : |
98
+ if [ -z "${{ inputs.dokka_artifact_url }}" ]; then
99
+ echo "'dokka_artifact_url' is not set"
100
+ exit 1
101
+ fi
102
+
103
+ if [ ${{ inputs.dry_run }} == true ]; then
104
+ echo "Dry run mode is enabled."
105
+ curl -v -s -f -L \
106
+ -H "Authorization: Bearer ${{ secrets.TEAMCITY_TOKEN }}" \
107
+ ${{ inputs.dokka_artifact_url }} -o ${{ env.DOKKA_ARTIFACT }}
108
+ else
109
+ curl -v -s -f -L \
110
+ ${{ inputs.dokka_artifact_url }} -o ${{ env.DOKKA_ARTIFACT }}
111
+ fi
97
112
98
113
- name : Unzip Dokka
99
114
run : unzip -O UTF-8 -qq '${{ env.DOKKA_ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}/api
@@ -110,7 +125,7 @@ jobs:
110
125
retention-days : 7
111
126
112
127
deploy :
113
- if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
128
+ if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && !inputs.dry_run
114
129
environment :
115
130
name : github-pages
116
131
url : ${{ steps.deployment.outputs.page_url }}
@@ -138,7 +153,7 @@ jobs:
138
153
uses : actions/deploy-pages@v4
139
154
140
155
publish-indexes :
141
- if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
156
+ if : github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && !inputs.dry_run
142
157
needs : [ build, test, assemble, deploy ]
143
158
runs-on : ubuntu-latest
144
159
container :
0 commit comments