Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

ci: publish documentation to Cloudflare Pages #1

ci: publish documentation to Cloudflare Pages

ci: publish documentation to Cloudflare Pages #1

name: Publish Writerside and JSDoc documentation to Cloudflare Pages
on:
push:
branches:
- main
- 'Sprint-[0-9]*'
- 'patch-[0-9]*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
WRS_INSTANCE: docs/ucwa
WRS_ARTIFACT: webHelpUCWA2-all.zip
WRS_DOCKER_VERSION: 232.10275
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: 'Documentation'
url: ${{ steps.deploy-to-cloudflare-pages.outputs.url }}
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build jsdoc documentation
uses: andstor/jsdoc-action@v1
with:
source_dir: .
recurse: true
output_dir: ./built_docs/jsdoc
- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.WRS_INSTANCE }}
artifact: ${{ env.WRS_ARTIFACT }}
docker-version: ${{ env.WRS_DOCKER_VERSION }}
- name: Upload Writerside documentation artifact
uses: actions/upload-artifact@v3
with:
name: wrs_docs
path: |
artifacts/${{ env.WRS_ARTIFACT }}
artifacts/report.json
retention-days: 7
- name: Test Writerside documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.WRS_INSTANCE }}
- name: Unzip Writerside artifact
uses: montudor/action-zip@v1
with:
args: unzip -qq artifacts/${{ env.WRS_ARTIFACT }} -d ./built_docs/code
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
id: deploy-to-cloudflare-pages
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: built_docs
gitHubToken: ${{ secrets.GITHUB_TOKEN }}