From 6ffa4217442fd226766288523e35bc3c8114405b Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 26 Sep 2024 14:17:52 -0700 Subject: [PATCH] Storybook page, exclude Jotai from dependabot, use NodeJS 20 for builds (#868) --- .github/dependabot.yml | 1 + .github/workflows/build-helper.yml | 4 +-- .github/workflows/bump-version.yml | 2 +- .github/workflows/codeql.yml | 5 +-- .github/workflows/deploy-storybook.yml | 42 ++++++++++++++++++++++++++ .storybook/manager.ts | 6 ++++ .storybook/theme.ts | 9 ++++++ .vscode/settings.json | 9 ++++++ CNAME | 1 + 9 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/deploy-storybook.yml create mode 100644 .storybook/manager.ts create mode 100644 .storybook/theme.ts create mode 100644 CNAME diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 80a999287..243e59d5f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,6 +20,7 @@ updates: dependency-type: "production" exclude-patterns: - "*electron*" + - "jotai" electron: patterns: - "*electron*" diff --git a/.github/workflows/build-helper.yml b/.github/workflows/build-helper.yml index e9701221d..d10c0d9ec 100644 --- a/.github/workflows/build-helper.yml +++ b/.github/workflows/build-helper.yml @@ -9,8 +9,8 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+*" env: - GO_VERSION: "1.22.5" - NODE_VERSION: "22.5.1" + GO_VERSION: "1.22" + NODE_VERSION: "20" jobs: runbuild: permissions: diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 1dbc29513..23450b94f 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -23,7 +23,7 @@ on: type: boolean default: true env: - NODE_VERSION: "22.5.1" + NODE_VERSION: "20" jobs: bump-version: runs-on: ubuntu-latest diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d7ce0e3a4..21a5dcc02 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,8 @@ on: - cron: "36 5 * * 5" env: - NODE_VERSION: "21.5.0" + NODE_VERSION: "20" + GO_VERSION: "1.22.5" jobs: analyze: @@ -68,7 +69,7 @@ jobs: if: matrix.language == 'go' uses: actions/setup-go@v5 with: - go-version: stable + go-version: ${{env.GO_VERSION}} cache-dependency-path: | go.sum # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml new file mode 100644 index 000000000..4a475fb79 --- /dev/null +++ b/.github/workflows/deploy-storybook.yml @@ -0,0 +1,42 @@ +# Workflow name +name: Build and Publish Storybook to GitHub Pages + +on: + push: + branches: + - "main" + +permissions: + contents: read + pages: write + id-token: write + +env: + NODE_VERSION: "20" + +# List of jobs +jobs: + deploy: + runs-on: ubuntu-latest + # Job steps + steps: + # Manual Checkout + - uses: actions/checkout@v4 + + # Set up Node + - uses: actions/setup-node@v4 + with: + node-version: ${{env.NODE_VERSION}} + + - name: Install yarn + run: | + corepack enable + yarn install + + #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow + - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 + with: + install_command: yarn # default: npm ci + build_command: yarn build-storybook # default: npm run build-storybook + path: storybook-static # default: dist/storybook + checkout: false # default: true diff --git a/.storybook/manager.ts b/.storybook/manager.ts new file mode 100644 index 000000000..34e8f196c --- /dev/null +++ b/.storybook/manager.ts @@ -0,0 +1,6 @@ +import { addons } from "@storybook/manager-api"; +import theme from "./theme"; + +addons.setConfig({ + theme, +}); diff --git a/.storybook/theme.ts b/.storybook/theme.ts new file mode 100644 index 000000000..23fad617a --- /dev/null +++ b/.storybook/theme.ts @@ -0,0 +1,9 @@ +import { create } from "@storybook/theming"; + +export default create({ + base: "light", + brandTitle: "Wave Terminal Storybook", + brandUrl: "https://www.waveterm.dev", + brandImage: "../assets/wave-light.png", + brandTarget: "_self", +}); diff --git a/.vscode/settings.json b/.vscode/settings.json index 17dd10412..624f97b2c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -36,5 +36,14 @@ }, "[go]": { "editor.defaultFormatter": "golang.go" + }, + "[plaintext]": { + "editor.formatOnSave": false, + "editor.formatOnPaste": false, + "files.insertFinalNewline": false, + "files.trimFinalNewlines": true + }, + "files.associations": { + "CNAME": "plaintext" } } diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..588356a43 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +storybook.waveterm.dev \ No newline at end of file