diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml new file mode 100644 index 0000000000000..40e7827568dfd --- /dev/null +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -0,0 +1,50 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - web-components-v3 + paths: + - packages/web-components/* + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - web-components-v3 + paths: + - packages/web-components/* + +permissions: + contents: read + pull-requests: write + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v2 + + - name: Build and Deploy Job + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.WEB_COMPONENTS_AZURE_STATIC_WEB_APPS_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub integrations (i.e. PR comments) + action: 'upload' + app_build_command: 'yarn workspace @fluentui/web-components build-storybook' + app_location: '/packages/web-components' # App source code path relative to repository root + output_location: 'dist/storybook' # Built app content directory, relative to app_location - optional + skip_api_build: true + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.WEB_COMPONENTS_AZURE_STATIC_WEB_APPS_API_TOKEN }} + action: 'close' diff --git a/change/@fluentui-web-components-b1d83acd-4849-4848-b056-d97f03b7c37c.json b/change/@fluentui-web-components-b1d83acd-4849-4848-b056-d97f03b7c37c.json new file mode 100644 index 0000000000000..c1d34f9cc3666 --- /dev/null +++ b/change/@fluentui-web-components-b1d83acd-4849-4848-b056-d97f03b7c37c.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "ci: setup web-components docsite CI/CD", + "packageName": "@fluentui/web-components", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/web-components/.storybook/main.cjs b/packages/web-components/.storybook/main.cjs index c59c22b608b91..cfe2fcd503e19 100644 --- a/packages/web-components/.storybook/main.cjs +++ b/packages/web-components/.storybook/main.cjs @@ -2,11 +2,12 @@ const CircularDependencyPlugin = require('circular-dependency-plugin'); const tsBin = require.resolve('typescript'); -module.exports = { +module.exports = /** @type {Omit} */ ({ stories: ['../src/**/*.stories.@(ts|mdx)'], staticDirs: ['../public'], core: { builder: 'webpack5', + disableTelemetry: true, }, addons: [ { @@ -60,4 +61,4 @@ module.exports = { return config; }, -}; +});