fix: versions #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy documentation | |
on: | |
push: | |
branches: ["trunk"] | |
env: | |
# Name of module and id separated by a slash | |
WS_INSTANCE: Writerside/hi | |
# Replace HI with the ID of the instance in capital letters | |
WS_ARTIFACT: webHelpHI2-all.zip | |
# Writerside docker image version | |
WS_DOCKER_VERSION: 232.10275 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Build Writerside docs using Docker | |
uses: JetBrains/writerside-github-action@v4 | |
with: | |
instance: ${{ env.WS_INSTANCE }} | |
artifact: ${{ env.WS_ARTIFACT }} | |
docker-version: ${{ env.WS_DOCKER_VERSION }} | |
- name: Upload documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: | | |
artifacts/${{ env.WS_ARTIFACT }} | |
artifacts/report.json | |
retention-days: 7 | |
# Add the step below to upload Algolia indexes | |
- name: Upload algolia-indexes | |
uses: actions/upload-artifact@v4 | |
with: | |
name: algolia-indexes | |
path: artifacts/${{ env.ALGOLIA_ARTIFACT }} | |
retention-days: 7 | |
upload-to-github-pages: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: artifacts | |
- name: Un-archive artifacts for github pages. | |
run: | | |
cd artifacts | |
mkdir ws_artifacts | |
unzip $WS_ARTIFACT -d ws_artifacts | |
- name: Upload to github pages | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: artifacts/ws_artifacts | |
# Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors | |
test: | |
# Requires build job results | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: artifacts | |
- name: Test documentation | |
uses: JetBrains/writerside-checker-action@v1 | |
with: | |
instance: ${{ env.INSTANCE }} | |
deploy: | |
needs: upload-to-github-pages | |
runs-on: ubuntu-latest | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to github pages | |
uses: actions/deploy-pages@v4 | |
id: deployment | |
with: | |
token: ${{ github.token }} |