Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map package names to url slugs for doc publishing #6020

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ jobs:
id: parse-release-tag
with:
release-tag: ${{ github.event.inputs.tag || github.ref_name }}
- uses: kanga333/[email protected]
name: Map package to environment variables
with:
key: ${{steps.parse-release-tag.outputs.package-name}}
map: |
{
"realm-react": {
"URL_SLUG": "react"
},
"realm-web": {
"URL_SLUG": "web"
},
"realm": {
"URL_SLUG": "js"
}
}
- uses: actions/checkout@v3
with:
submodules: "recursive"
Expand All @@ -51,10 +67,7 @@ jobs:
access_key: ${{ secrets.DOCS_S3_ACCESS_KEY }}
secret_key: ${{ secrets.DOCS_S3_SECRET_KEY }}
- name: Set up S3 base URL for packages
run: echo "S3_BASE_URL=s3://${{ secrets.DOCS_S3_BUCKET_NAME }}/docs/realm-sdks/js/${{steps.parse-release-tag.outputs.package-name}}" >> $GITHUB_ENV
- name: Set up S3 base URL for realm
if: steps.parse-release-tag.outputs.package-name == 'realm'
run: echo "S3_BASE_URL=s3://${{ secrets.DOCS_S3_BUCKET_NAME }}/docs/realm-sdks/js" >> $GITHUB_ENV
run: echo "S3_BASE_URL=s3://${{ secrets.DOCS_S3_BUCKET_NAME }}/docs/realm-sdks/${{env.URL_SLUG}}" >> $GITHUB_ENV
# --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)
Expand All @@ -69,4 +82,3 @@ jobs:
working-directory: packages/${{ steps.parse-release-tag.outputs.package-name }}
run: |
s3cmd put --recursive --acl-public --no-mime-magic --guess-mime-type docs/ ${{ env.S3_BASE_URL }}/latest/
s3cmd put --recursive --acl-public --no-mime-magic --guess-mime-type docs/ ${{ env.S3_BASE_URL }}/
Loading