Skip to content

Commit feafddc

Browse files
committed
rollback
1 parent 4a68781 commit feafddc

File tree

1 file changed

+8
-75
lines changed

1 file changed

+8
-75
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,10 @@ on:
66
- 'docs/pages/**'
77
- '.github/workflows/**'
88
workflow_dispatch:
9-
inputs:
10-
build_id:
11-
description: 'Id of TeamCity build that produced the 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
17-
required: true
189

1910
permissions:
2011
id-token: write
2112
pages: write
22-
contents: read
2313

2414
env:
2515
INSTANCE: 'kotlinx-rpc/rpc'
@@ -30,10 +20,7 @@ env:
3020
ALGOLIA_INDEX_NAME: 'prod_kotlin_rpc'
3121
ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}'
3222
CONFIG_JSON_PRODUCT: 'kotlinx-rpc'
33-
CONFIG_JSON_VERSION: '0.8.0'
34-
DOKKA_ARTIFACT: 'dokka.zip'
35-
ASSEMBLE_DIR: '__docs_assembled'
36-
ASSEMBLE_ARTIFACT: 'assembled.zip'
23+
CONFIG_JSON_VERSION: '0.7.0'
3724

3825
jobs:
3926
build:
@@ -77,91 +64,37 @@ jobs:
7764
with:
7865
instance: ${{ env.INSTANCE }}
7966

80-
assemble:
81-
if: github.event_name == 'workflow_dispatch'
82-
needs: [ build, test ]
83-
runs-on: ubuntu-latest
84-
steps:
85-
- name: Checkout repository
86-
uses: actions/checkout@v4
87-
with:
88-
fetch-depth: 0
89-
90-
- name: Download Writerside artifacts
91-
uses: actions/download-artifact@v4
92-
with:
93-
name: kotlinx-rpc
94-
95-
- name: Unzip Writerside artifacts
96-
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}
97-
98-
- name: Download Dokka
99-
run: |
100-
if [ -z "${{ inputs.build_id }}" ]; then
101-
echo "'build_id' is not set"
102-
exit 1
103-
fi
104-
105-
echo "Downloading Dokka artifact, build id: ${{ inputs.build_id }}"
106-
107-
artifact_url="https://krpc.teamcity.com/app/rest/builds/id:${{ inputs.build_id }}/artifacts/content/${{ env.DOKKA_ARTIFACT }}"
108-
echo "Downloading Dokka artifact from URL: $artifact_url"
109-
110-
curl -v -s -f -L -H "Authorization: Bearer ${{ secrets.TEAMCITY_TOKEN }}" "$artifact_url" -o "${{ env.DOKKA_ARTIFACT }}"
111-
112-
if [ -z "$(ls | grep -x ${{ env.DOKKA_ARTIFACT }})" ]; then
113-
echo "Failed to download Dokka artifact, asset id: ${{ inputs.build_id }}"
114-
exit 1
115-
fi
116-
117-
- name: Unzip Dokka
118-
run: unzip -O UTF-8 -qq '${{ env.DOKKA_ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}/api
119-
120-
- name: Update sitemap.xml
121-
run: chmod +x updateSitemap.sh && ./updateSitemap.sh ${{ env.ASSEMBLE_DIR }}/sitemap.xml ${{ env.ASSEMBLE_DIR }}/api
122-
123-
- name: Assemble file
124-
run: zip -r ${{ env.ASSEMBLE_ARTIFACT}} ${{ env.ASSEMBLE_DIR }}
125-
126-
- name: Save assembled artifact
127-
uses: actions/upload-artifact@v4
128-
with:
129-
name: kotlinx-rpc-assembled
130-
path: |
131-
${{ env.ASSEMBLE_ARTIFACT }}
132-
retention-days: 7
133-
13467
deploy:
135-
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/release-') && !inputs.dry_run
68+
if: github.event_name == 'workflow_dispatch'
13669
environment:
13770
name: github-pages
13871
url: ${{ steps.deployment.outputs.page_url }}
139-
needs: [ build, test, assemble ]
72+
needs: [ build, test ]
14073
runs-on: ubuntu-latest
14174
steps:
14275
- name: Download artifacts
14376
uses: actions/download-artifact@v4
14477
with:
145-
name: kotlinx-rpc-assembled
78+
name: kotlinx-rpc
14679

14780
- name: Unzip artifact
148-
run: unzip -O UTF-8 -qq '${{ env.ASSEMBLE_ARTIFACT }}' -d publish
81+
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d dir
14982

15083
- name: Setup Pages
15184
uses: actions/configure-pages@v5
15285

15386
- name: Package and upload Pages artifact
15487
uses: actions/upload-pages-artifact@v3
15588
with:
156-
path: publish
89+
path: dir
15790

15891
- name: Deploy to GitHub Pages
15992
id: deployment
16093
uses: actions/deploy-pages@v4
16194

16295
publish-indexes:
163-
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/release-') && !inputs.dry_run
164-
needs: [ build, test, assemble, deploy ]
96+
if: github.event_name == 'workflow_dispatch'
97+
needs: [ build, test, deploy ]
16598
runs-on: ubuntu-latest
16699
container:
167100
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3

0 commit comments

Comments
 (0)