diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 3e2ff7d..443da58 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,23 +1,18 @@ -name: Build and Deploy Writerside Documentation +name: Build documentation on: push: - branches: ["main"] # Trigger the workflow when changes are pushed to the 'main' branch - workflow_dispatch: # Allow manual triggering of the workflow - -permissions: - id-token: write - pages: write + branches: ['main'] + workflow_dispatch: env: - INSTANCE: Writerside/Kurocado Studio Styleguide - ARTIFACT: webHelpKSS2-all.zip - DOCKER_VERSION: latest + INSTANCE: 'Writerside/Kurocado Studio Styleguide' + ARTIFACT: 'webHelpKSS2-all.zip' + DOCKER_VERSION: '242.21870' jobs: build: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v4 @@ -25,51 +20,32 @@ jobs: token: ${{ secrets.GH_TOKEN }} # Use Personal Access Token (PAT) fetch-depth: 0 - - name: Pull Writerside Docker image # Add this step to explicitly pull the Docker image - run: docker pull registry.jetbrains.team/p/writerside/builder/writerside-builder:${{ env.DOCKER_VERSION }} - - - name: Build Writerside docs using Docker + - name: Build docs using Writerside Docker builder uses: JetBrains/writerside-github-action@v4 with: instance: ${{ env.INSTANCE }} artifact: ${{ env.ARTIFACT }} docker-version: ${{ env.DOCKER_VERSION }} - location: Writerside # Specify the directory for Writerside docs - - name: Upload artifact + - name: Save artifact with build results uses: actions/upload-artifact@v4 with: name: docs path: | artifacts/${{ env.ARTIFACT }} + artifacts/report.json retention-days: 7 - - deploy: - environment: - name: github-pages + test: needs: build runs-on: ubuntu-latest - steps: - - name: Download artifact + - name: Download artifacts uses: actions/download-artifact@v4 with: name: docs + path: artifacts - - name: Unzip artifact - run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir - - - name: Setup Pages - uses: actions/configure-pages@v4.0.0 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3.0.1 + - name: Test documentation + uses: JetBrains/writerside-checker-action@v1 with: - path: dir - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4.0.4 - - - name: Print GitHub Pages URL - run: echo "Your site is deployed at ${{ steps.deployment.outputs.page_url }}" + instance: ${{ env.INSTANCE }}