Skip to content

Commit

Permalink
Temporaily add jsdoc publish to restore legacy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
takameyer committed Jul 31, 2023
1 parent 0b9dd8b commit cd9025f
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/jsdoc-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow builds the JSDocs and publishes them to https://docs.mongodb.com/realm-sdks/js/latest/.
# It also uploads them to a versioned directory for archival purposes.
#
# We only run this workflow for "vX.Y.Z" tags, not "vX.Y.Z-beta", as the docs are pushed to the
# site as "latest" as part of the build and we don't want to publish beta docs to live

name: JSDoc Publish
on:
push:
tags:
- v[0-9]+\.[0-9]+\.[0-9]+
workflow_dispatch:

env:
REALM_DISABLE_ANALYTICS: 1
jobs:
jsdoc:
name: JSDoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install npm v7
run: npm install -g npm@8
# Install the root package (--ignore-scripts to avoid downloading or building the native module)
- name: Install root package dependencies
run: npm ci --ignore-scripts
- name: Run JSDoc documentation build
run: npm run jsdoc
- name: Set up S3cmd and configure AWS credentials
uses: s3-actions/[email protected]
with:
provider: aws
region: "us-west-1"
access_key: ${{ secrets.DOCS_S3_ACCESS_KEY }}
secret_key: ${{ secrets.DOCS_S3_SECRET_KEY }}
# Get the version number so we can specify the correct input path for uploading the docs -
# JSDoc outputs to docs/output/realm/<package.json version number>
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
# --no-mime-magic --guess-mime-type flags to work around CSS incorrect MIME type issue
# (https://stackoverflow.com/questions/53708938/s3cmd-flagging-css-with-wrong-mime-type)
- name: Upload versioned docs (for archival)
run: s3cmd put --recursive --acl-public --no-mime-magic --guess-mime-type docs/output/realm/${{ steps.package-version.outputs.current-version}}/ s3://${{ secrets.DOCS_S3_BUCKET_NAME }}/docs/realm-sdks/js/${{ steps.package-version.outputs.current-version}}/
- name: Upload latest docs (to live site)
run: s3cmd put --recursive --acl-public --no-mime-magic --guess-mime-type docs/output/realm/${{ steps.package-version.outputs.current-version}}/ s3://${{ secrets.DOCS_S3_BUCKET_NAME }}/docs/realm-sdks/js/latest/

0 comments on commit cd9025f

Please sign in to comment.