Skip to content

Commit

Permalink
Add: preview_pages用のWorkflowを追加 (#2342)
Browse files Browse the repository at this point in the history
Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
sevenc-nanashi and Hiroshiba authored Nov 6, 2024
1 parent 47f03f8 commit 6355ee9
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/DANGEROUS_trigger_preview_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Trigger preview-pages' workflow"

# プレビュー用ページのワークフローを起動する。
# 詳細: https://github.com/voicevox/preview-pages?tab=readme-ov-file#%E4%BB%95%E7%B5%84%E3%81%BF

on:
pull_request_target:
types:
- opened
- synchronize
- closed
- reopened
push:
branches:
- main
- project-*

jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow
run: |
gh workflow run -R voicevox/preview-pages update_pages.yml
env:
GH_TOKEN: ${{ secrets.TRIGGER_PREVIEW_PAGES_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/build_preview_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Build Preview Pages"

# プレビュー用ページをビルドする。
# 詳細: https://github.com/voicevox/preview-pages?tab=readme-ov-file#%E4%BB%95%E7%B5%84%E3%81%BF

on:
push:
branches:
- main
- project-*
pull_request:

jobs:
update_pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup-environment

- name: Build
run: |
npm run storybook:build -- --preview-url ./ --output-dir dist_preview/storybook
npm run browser:build -- --base ./ --outDir dist_preview/editor
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: preview-pages
path: dist_preview
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ electron-builder.yml

# Storybook
storybook-static/

# Preview Build Output
dist_preview/
4 changes: 2 additions & 2 deletions src/backend/browser/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
} from "@/type/preload";
import { AssetTextFileNames } from "@/type/staticResources";

// TODO: base pathを設定できるようにするか、ビルド時埋め込みにする
const toStaticPath = (fileName: string) => `/${fileName}`;
const toStaticPath = (fileName: string) =>
`${import.meta.env.BASE_URL}/${fileName}`.replaceAll(/\/\/+/, "/");

// FIXME: asを使わないようオーバーロードにした。オーバーロードも使わない書き方にしたい。
function onReceivedIPCMsg<
Expand Down

0 comments on commit 6355ee9

Please sign in to comment.