-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map package names to url slugs for doc publishing
- Loading branch information
Showing
1 changed file
with
17 additions
and
5 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 |
---|---|---|
|
@@ -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": { | ||
"URL_SLUG": "js" | ||
}, | ||
"realm-react": { | ||
"URL_SLUG": "react" | ||
}, | ||
"realm-web": { | ||
"URL_SLUG": "web" | ||
} | ||
} | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
@@ -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) | ||
|
@@ -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 }}/ |