From c4f9a5d5597d56d254b809cb6ac86f11e5c71953 Mon Sep 17 00:00:00 2001 From: ling1726 Date: Fri, 3 Feb 2023 16:28:26 +0100 Subject: [PATCH 1/4] Update azure-static-web-apps-deploy.yml --- .github/workflows/azure-static-web-apps-deploy.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 40e7827568dfd..4f1c66c623277 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -37,6 +37,16 @@ jobs: output_location: 'dist/storybook' # Built app content directory, relative to app_location - optional skip_api_build: true + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Azure CLI Action + uses: Azure/cli@v1.0.7 + with: + # Specify the script here + inlineScript: az storage blob upload-batch --account-name webcomponentsdocsite --auth-mode key -d '$web' -s ./packages/web-components/dist/storybook + close_pull_request_job: if: github.event_name == 'pull_request' && github.event.action == 'closed' runs-on: ubuntu-latest From 59400e36583ef981fb899aabe79ac34e0a2675c9 Mon Sep 17 00:00:00 2001 From: ling1726 Date: Fri, 3 Feb 2023 16:33:34 +0100 Subject: [PATCH 2/4] Update and rename azure-static-web-apps-deploy.yml to azure-storage-web-components.yml --- .../azure-static-web-apps-deploy.yml | 60 ------------------- .../azure-storage-web-components.yml | 39 ++++++++++++ 2 files changed, 39 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/azure-static-web-apps-deploy.yml create mode 100644 .github/workflows/azure-storage-web-components.yml diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml deleted file mode 100644 index 4f1c66c623277..0000000000000 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ /dev/null @@ -1,60 +0,0 @@ -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 - - - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - - name: Azure CLI Action - uses: Azure/cli@v1.0.7 - with: - # Specify the script here - inlineScript: az storage blob upload-batch --account-name webcomponentsdocsite --auth-mode key -d '$web' -s ./packages/web-components/dist/storybook - - 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/.github/workflows/azure-storage-web-components.yml b/.github/workflows/azure-storage-web-components.yml new file mode 100644 index 0000000000000..1fbf3fab5d040 --- /dev/null +++ b/.github/workflows/azure-storage-web-components.yml @@ -0,0 +1,39 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + 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: Setup Node.js environment + uses: actions/setup-node@v3.6.0 + with: + node-version: 14.x + + - run: yarn + + - run: yarn workspace @fluentui/web-components build-storybook + + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Azure CLI Action + uses: Azure/cli@v1.0.7 + with: + # Specify the script here + inlineScript: az storage blob upload-batch --account-name webcomponentsdocsite --auth-mode key -d '$web' -s ./packages/web-components/dist/storybook From d0d5330b8c23b693bbb1f3b79aa99d5fe867cfd2 Mon Sep 17 00:00:00 2001 From: ling1726 Date: Fri, 3 Feb 2023 16:34:46 +0100 Subject: [PATCH 3/4] Update azure-storage-web-components.yml --- .github/workflows/azure-storage-web-components.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/azure-storage-web-components.yml b/.github/workflows/azure-storage-web-components.yml index 1fbf3fab5d040..4b11931a5060e 100644 --- a/.github/workflows/azure-storage-web-components.yml +++ b/.github/workflows/azure-storage-web-components.yml @@ -1,11 +1,7 @@ name: Azure Static Web Apps CI/CD on: - push: - branches: - - web-components-v3 - paths: - - packages/web-components/* + workflow_dispatch: permissions: contents: read From 65460dcdba49d3c7fbd84d0c94bc5d7ab6263357 Mon Sep 17 00:00:00 2001 From: ling1726 Date: Fri, 3 Feb 2023 16:36:43 +0100 Subject: [PATCH 4/4] Create azure-static-web-apps-deploy.yml --- .../azure-static-web-apps-deploy.yml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-deploy.yml 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'