From fa5a0bce816ff9c20d0c451358cca1677ff1b35c Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 26 Nov 2024 13:45:30 -0800 Subject: [PATCH 1/4] [TM-1493] Deploy storybook to github pages. --- .github/workflows/deploy-github-storybook.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy-github-storybook.yml diff --git a/.github/workflows/deploy-github-storybook.yml b/.github/workflows/deploy-github-storybook.yml new file mode 100644 index 000000000..fd9d9b3c8 --- /dev/null +++ b/.github/workflows/deploy-github-storybook.yml @@ -0,0 +1,29 @@ +# Workflow taken from the Storybook docs: https://storybook.js.org/docs/sharing/publish-storybook#github-pages +name: Build and Publish Storybook to GitHub Pages + +on: + push: + branches: + - 'task/TM-1493-github-storybook' # TODO update to 'staging' before PR + +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 + with: + install_command: yarn install + build_command: yarn build-storybook + path: storybook-static + checkout: false From a3cddde826ec0e25ca42f2510c2fbcdb6a75f5fe Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 26 Nov 2024 14:06:53 -0800 Subject: [PATCH 2/4] [TM-1493] Rebuild on all pushes to `staging` --- .github/workflows/deploy-github-storybook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-github-storybook.yml b/.github/workflows/deploy-github-storybook.yml index fd9d9b3c8..066c07517 100644 --- a/.github/workflows/deploy-github-storybook.yml +++ b/.github/workflows/deploy-github-storybook.yml @@ -4,7 +4,7 @@ name: Build and Publish Storybook to GitHub Pages on: push: branches: - - 'task/TM-1493-github-storybook' # TODO update to 'staging' before PR + - 'staging' permissions: contents: read From 604c7d125ef13cf632d36fc5782e97451f240f36 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 26 Nov 2024 14:10:16 -0800 Subject: [PATCH 3/4] [TM-1493] Add a link to the storybook build on the README. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 52675d4fa..9c1717f31 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # 🌲 Terramatch Web Platform 🌲 +### Storybook +We host the `staging` build of Storybook on [Github Pages](https://wri.github.io/wri-terramatch-website/) + ### Installation ``` From 0f8e6029448cedc0a5cb14fbfc61ae69dc5c12e0 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 26 Nov 2024 14:33:10 -0800 Subject: [PATCH 4/4] [TM-1493] Start including a production build of the app in the PR checks --- .github/workflows/pull-request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 194b0c659..3e76a0ac7 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,3 +14,5 @@ jobs: run: yarn - name: Test run: yarn run jest --ci + - name: Build + run: NEXT_PUBLIC_TARGET_ENV=staging yarn build