Skip to content

feat: a github action to deploy docs automatically #1

feat: a github action to deploy docs automatically

feat: a github action to deploy docs automatically #1

Workflow file for this run

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@v3
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@v3
with:
name: algolia-indexes
path: artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7
# 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@v1
with:
name: docs
path: artifacts
- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
deploy:
needs: build
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: Download artifacts
uses: actions/download-artifact@v1
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@v2
with:
path: artifacts/ws_artifacts
- name: Deploy to github pages
uses: actions/deploy-pages@v4
id: deployment