Skip to content
Merged
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions .github/actions/build-to/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Build workspaces'
Comment thread
ling1726 marked this conversation as resolved.
description: 'Runs the build command for specific workspaces.'
inputs:
# Because Github Actions doesn't support arrays as inputs we need to pass the workspaces as a string and split them
# by spaces https://github.com/community/community/discussions/11692
workspaces:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on my previous comment, this should be rather singular

Suggested change
workspaces:
workspace:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the previous discussion (about this input being an array), I think we should keep it plural, ie workspaces.

required: true
description: 'The workspaces you want to build. This parameter accepts multiple workspaces separated by a space.'
# This is based on the backfill cache provider options: https://github.com/microsoft/backfill#set-up-remote-cache
backfill-cache-provider:
required: false
description: 'The backfill cache provider'
default: 'azure-blob'
# Depending on the chosen cache provider there are multiple types of available options. In our case we use Azure Blob
# Storage. https://github.com/microsoft/backfill#microsoft-azure-blob-storage
backfill-cache-provider-options:
required: false
description: 'The backfill cache provider options'
# Flag to toggle backfill remote caching on / off
lage-write-remote-cache:
required: true
description: 'Whether to write to the remote cache'
default: 'true'

runs:
using: 'composite'
steps:
- name: build package dependency tree (scripts:build)
working-directory: .
shell: bash
run: yarn build --to ${{ inputs.workspaces }}
env:
BACKFILL_CACHE_PROVIDER: ${{ inputs.backfill-cache-provider }}
BACKFILL_CACHE_PROVIDER_OPTIONS: ${{ inputs.backfill-cache-provider-options }}
LAGE_WRITE_REMOTE_CACHE: ${{ inputs.lage-write-remote-cache }}
5 changes: 4 additions & 1 deletion .github/workflows/docsite-publish-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ jobs:
run: yarn install --frozen-lockfile

- name: Build dependencies
run: yarn build --to @fluentui/public-docsite-v9
uses: ./.github/actions/build-to
with:
workspaces: '@fluentui/public-docsite-v9'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: can this be an array (based on the naming), if not can we rename this to workspace ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked up the option of having inputs as arrays but apparently it's not possible. I thought of naming it workspace initially but you could still pass multiple values here and it will still work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would that look like ? @fluentui/public-docsite-v9,@fluentui/foo,@fluentui/bar ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space separated, @fluentui/public-docsite-v9 @fluentui/foo,@fluentui/bar. There's the option of using JS arrays and then JSON.parse them, but I think that will make them worse: community/community#11692 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah lets avoid that. last thing - can you please add documentation to that input so one can find how to define multiple workspaces ? ty

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to give more details about why we chose this approach and improved the field's description.

backfill-cache-provider-options: ${{ secrets.BACKFILL_CACHE_PROVIDER_OPTIONS }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please update our build docs for the docsite release so that this is all in there ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation has been updated for the Chromatic deployment and a new one for the Github Pages deployment was created.


- name: Publish to Chromatic
run: yarn workspace @fluentui/public-docsite-v9 chromatic
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docsite-publish-ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ jobs:
run: yarn install --frozen-lockfile

- name: Build dependencies
run: yarn build --to @fluentui/public-docsite-v9
uses: ./.github/actions/build-to
with:
workspaces: '@fluentui/public-docsite-v9'
backfill-cache-provider-options: ${{ secrets.BACKFILL_CACHE_PROVIDER_OPTIONS }}

- name: Build storybook
run: yarn workspace @fluentui/public-docsite-v9 build-storybook
Expand Down