-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporaily add jsdoc publish to restore legacy docs
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 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
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/ |