From ed3f9f24c63b73d2687b9ab104c07acc6f2aeae8 Mon Sep 17 00:00:00 2001 From: Amritha raj herle Date: Fri, 21 Jun 2024 21:21:03 +0200 Subject: [PATCH 1/3] feat: deploy storybook to github page fixes: https://github.com/carbon-design-system/carbon-addons-iot-react/issues/3867 --- .github/README.MD | 4 ++-- .github/workflows/deploy.yml | 38 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- packages/react/README.MD | 4 ++-- packages/react/package.json | 2 +- 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/README.MD b/.github/README.MD index 6e84587efe..b863f28624 100644 --- a/.github/README.MD +++ b/.github/README.MD @@ -1,4 +1,4 @@ -> [!WARNING] +> [!WARNING] > This library no longer has a dedicated development resource maintaining it. When you are able to [migrate to Carbon v11](https://carbondesignsystem.com/migrating/guide/overview/) we recommend you reference the [related component guide](migration.md) and use components from [Carbon for IBM Products](https://carbon-for-ibm-products.netlify.app/?path=/story/overview-welcome--overview) and core [Carbon](https://react.carbondesignsystem.com/).

@@ -40,7 +40,7 @@ **@latest from [`master`](https://github.com/carbon-design-system/carbon-addons-iot-react/tree/master)** -  -   +  -   view @latest storybook diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000..1af6b5867d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,38 @@ +name: Deploy + +on: + push: + branches: + - 'next' + +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.build-publish.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '16.x' + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: | + node_modules + */*/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + + - id: build-publish + uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 + with: + path: packages/react/storybook-static + install_command: yarn --frozen-lockfile + build_command: yarn build:storybook diff --git a/package.json b/package.json index 45a1dadd1d..e81d8389db 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "bugs": { "url": "https://github.com/carbon-design-system/carbon-addons-iot-react/issues" }, - "homepage": "https://carbon-addons-iot-react.com", + "homepage": "https://carbon-design-system.github.io/carbon-addons-iot-react", "scripts": { "build:storybook": "node ./scripts/storybook.js --build", "build": "lerna run --stream build", diff --git a/packages/react/README.MD b/packages/react/README.MD index 680e556cdc..4720f201c2 100644 --- a/packages/react/README.MD +++ b/packages/react/README.MD @@ -1,4 +1,4 @@ -> [!WARNING] +> [!WARNING] > This library no longer has a dedicated development resource maintaining it. When you are able to [migrate to Carbon v11](https://carbondesignsystem.com/migrating/guide/overview/) we recommend you reference the [related component guide](../../.github/migration.md) and use components from [Carbon for IBM Products](https://carbon-for-ibm-products.netlify.app/?path=/story/overview-welcome--overview) and core [Carbon](https://react.carbondesignsystem.com/).

@@ -40,7 +40,7 @@ **@latest from [`master`](https://github.com/carbon-design-system/carbon-addons-iot-react/tree/master)** -  -   +  -   view @latest storybook diff --git a/packages/react/package.json b/packages/react/package.json index 46467c897f..664e857fd9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -20,7 +20,7 @@ "bugs": { "url": "https://github.com/carbon-design-system/carbon-addons-iot-react/issues" }, - "homepage": "https://carbon-addons-iot-react.com", + "homepage": "https://carbon-design-system.github.io/carbon-addons-iot-react", "scripts": { "build": "yarn svg-convert && cross-env BABEL_ENV='production' NODE_ENV='production' yarn build:pre && rollup -c && yarn build:post", "build:pre": "yarn test:engines && rimraf lib es umd css scss tmp storybook-static", From 381b467b2c894b5526a74f52f3d7c254c35b284c Mon Sep 17 00:00:00 2001 From: Amritha raj herle Date: Fri, 21 Jun 2024 21:39:05 +0200 Subject: [PATCH 2/3] test: current branch changes --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1af6b5867d..40bb06be7e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy on: push: branches: - - 'next' + - 'feat-pulish-to-github-page' permissions: contents: read From 1e9c7cc71e5c628314c3b33d392abd892eceef6d Mon Sep 17 00:00:00 2001 From: Amritha raj herle Date: Fri, 21 Jun 2024 21:53:54 +0200 Subject: [PATCH 3/3] fix: deploy only when code is updated on next branch --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 40bb06be7e..1af6b5867d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy on: push: branches: - - 'feat-pulish-to-github-page' + - 'next' permissions: contents: read