Skip to content

Commit 4a68781

Browse files
committed
Update pages publication
1 parent 6fcb792 commit 4a68781

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/docs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,19 @@ jobs:
120120
- name: Update sitemap.xml
121121
run: chmod +x updateSitemap.sh && ./updateSitemap.sh ${{ env.ASSEMBLE_DIR }}/sitemap.xml ${{ env.ASSEMBLE_DIR }}/api
122122

123+
- name: Assemble file
124+
run: zip -r ${{ env.ASSEMBLE_ARTIFACT}} ${{ env.ASSEMBLE_DIR }}
125+
123126
- name: Save assembled artifact
124127
uses: actions/upload-artifact@v4
125128
with:
126129
name: kotlinx-rpc-assembled
127130
path: |
128-
${{ env.ASSEMBLE_DIR }}
131+
${{ env.ASSEMBLE_ARTIFACT }}
129132
retention-days: 7
130133

131134
deploy:
132-
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && !inputs.dry_run
135+
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/release-') && !inputs.dry_run
133136
environment:
134137
name: github-pages
135138
url: ${{ steps.deployment.outputs.page_url }}
@@ -142,22 +145,22 @@ jobs:
142145
name: kotlinx-rpc-assembled
143146

144147
- name: Unzip artifact
145-
run: unzip -O UTF-8 -qq '${{ env.ASSEMBLE_ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}
148+
run: unzip -O UTF-8 -qq '${{ env.ASSEMBLE_ARTIFACT }}' -d publish
146149

147150
- name: Setup Pages
148151
uses: actions/configure-pages@v5
149152

150153
- name: Package and upload Pages artifact
151154
uses: actions/upload-pages-artifact@v3
152155
with:
153-
path: ${{ env.ASSEMBLE_DIR }}
156+
path: publish
154157

155158
- name: Deploy to GitHub Pages
156159
id: deployment
157160
uses: actions/deploy-pages@v4
158161

159162
publish-indexes:
160-
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && !inputs.dry_run
163+
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/release-') && !inputs.dry_run
161164
needs: [ build, test, assemble, deploy ]
162165
runs-on: ubuntu-latest
163166
container:
@@ -166,7 +169,7 @@ jobs:
166169
- name: Download artifact
167170
uses: actions/download-artifact@v4
168171
with:
169-
name: kotlinx-rpc-assembled
172+
name: kotlinx-rpc
170173
- name: Unzip artifact
171174
run: |
172175
unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes

0 commit comments

Comments
 (0)