|
| 1 | +name: Build documentation |
| 2 | + |
| 3 | +on: |
| 4 | +# If specified, the workflow will be triggered automatically once you push to the `main` branch. |
| 5 | +# Replace `main` with your branch’s name |
| 6 | + push: |
| 7 | + branches: ["main"] |
| 8 | + |
| 9 | +# Specify to run a workflow manually from the Actions tab on GitHub |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +env: |
| 13 | + # Name of module and id separated by a slash |
| 14 | + INSTANCE: Writerside/hi |
| 15 | + # Replace HI with the ID of the instance in capital letters |
| 16 | + ARTIFACT: webHelpHI2-all.zip |
| 17 | + # Writerside docker image version |
| 18 | + DOCKER_VERSION: 232.10275 |
| 19 | +# Add the variable below to upload Algolia indexes |
| 20 | +# Replace HI with the ID of the instance in capital letters |
| 21 | + ALGOLIA_ARTIFACT: algolia-indexes-HI.zip |
| 22 | + |
| 23 | +jobs: |
| 24 | + build: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - name: Checkout repository |
| 28 | + uses: actions/checkout@v3 |
| 29 | + |
| 30 | + - name: Build Writerside docs using Docker |
| 31 | + uses: JetBrains/writerside-github-action@v4 |
| 32 | + with: |
| 33 | + instance: ${{ env.INSTANCE }} |
| 34 | + artifact: ${{ env.ARTIFACT }} |
| 35 | + docker-version: ${{ env.DOCKER_VERSION }} |
| 36 | + |
| 37 | + - name: Upload documentation |
| 38 | + uses: actions/upload-artifact@v3 |
| 39 | + with: |
| 40 | + name: docs |
| 41 | + path: | |
| 42 | + artifacts/${{ env.ARTIFACT }} |
| 43 | + artifacts/report.json |
| 44 | + retention-days: 7 |
| 45 | + |
| 46 | +# Add the step below to upload Algolia indexes |
| 47 | + - name: Upload algolia-indexes |
| 48 | + uses: actions/upload-artifact@v3 |
| 49 | + with: |
| 50 | + name: algolia-indexes |
| 51 | + path: artifacts/${{ env.ALGOLIA_ARTIFACT }} |
| 52 | + retention-days: 7 |
| 53 | + |
| 54 | +# Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors |
| 55 | + test: |
| 56 | + # Requires build job results |
| 57 | + needs: build |
| 58 | + runs-on: ubuntu-latest |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: Download artifacts |
| 62 | + uses: actions/download-artifact@v1 |
| 63 | + with: |
| 64 | + name: docs |
| 65 | + path: artifacts |
| 66 | + |
| 67 | + - name: Test documentation |
| 68 | + uses: JetBrains/writerside-checker-action@v1 |
| 69 | + with: |
| 70 | + instance: ${{ env.INSTANCE }} |
0 commit comments