This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: publish documentation to Cloudflare Pages
- Loading branch information
Showing
2 changed files
with
79 additions
and
40 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
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 }} |