Skip to content

Commit

Permalink
build: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Jun 10, 2024
1 parent 1b44ca4 commit cb566c4
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
# Replace HI with the ID of the instance in capital letters
ARTIFACT: webHelpHI2-all.zip
# Writerside docker image version
DOCKER_VERSION: 232.10275
DOCKER_VERSION: '241.16003'
# Add the variable below to upload Algolia indexes
# Replace HI with the ID of the instance in capital letters
ALGOLIA_ARTIFACT: algolia-indexes-HI.zip
Expand All @@ -35,7 +35,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
Expand All @@ -44,22 +46,15 @@ jobs:
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Upload documentation
uses: actions/upload-artifact@v3
- name: Save artifact with build results
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 1

# Add the step below to upload Algolia indexes
- name: Upload algolia-indexes
uses: actions/upload-artifact@v3
with:
name: algolia-indexes
path: artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 1
artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 4

deploy:
environment:
Expand All @@ -70,45 +65,46 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docs

- name: Unzip artifact
run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d dir

- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

publish-indexes:
# Requires the build-job results
needs: build
needs: [build, deploy]
runs-on: ubuntu-latest
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-2
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3

steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: algolia-indexes
name: docs

- name: Unzip artifact
run: |
unzip -O UTF-8 -qq ${{ env.ALGOLIA_ARTIFACT }} -d algolia-indexes
env "algolia-key=${{env.ALGOLIA_KEY}}" java -jar /opt/builder/help-publication-agent.jar \
unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes
env algolia-key='${{env.ALGOLIA_KEY}}' java -jar /opt/builder/help-publication-agent.jar \
update-index \
--application-name ${{env.ALGOLIA_APP_NAME}} \
--index-name ${{env.ALGOLIA_INDEX_NAME}} \
--product ${{env.CONFIG_JSON_PRODUCT}} \
--version ${{env.CONFIG_JSON_VERSION}} \
--application-name '${{env.ALGOLIA_APP_NAME}}' \
--index-name '${{env.ALGOLIA_INDEX_NAME}}' \
--product '${{env.CONFIG_JSON_PRODUCT}}' \
--version '${{env.CONFIG_JSON_VERSION}}' \
--index-directory algolia-indexes/ \
2>&1 | tee algolia-update-index-log.txt

0 comments on commit cb566c4

Please sign in to comment.