mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 02:27:05 +02:00
Merge pull request #4769 from mermaid-js/sidv/liveEditor
chore: Preview PRs with mermaid-live-editor on Netlify
This commit is contained in:
18
netlify.toml
Normal file
18
netlify.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
# Settings in the [build] context are global and are applied to
|
||||
# all contexts unless otherwise overridden by more specific contexts.
|
||||
[build]
|
||||
# Directory where the build system installs dependencies
|
||||
# and runs your build. Store your package.json, .nvmrc, etc here.
|
||||
# If not set, defaults to the root directory.
|
||||
base = ""
|
||||
|
||||
# Directory that contains the deploy-ready HTML files and
|
||||
# assets generated by the build. This is an absolute path relative
|
||||
# to the base directory, which is the root by default (/).
|
||||
# This sample publishes the directory located at the absolute
|
||||
# path "root/project/build-output"
|
||||
|
||||
publish = "mermaid-live-editor/docs"
|
||||
|
||||
# Default build command.
|
||||
command = "./scripts/editor.bash"
|
24
scripts/editor.bash
Executable file
24
scripts/editor.bash
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euxo pipefail
|
||||
# We have to use npm instead of yarn because it causes trouble in netlify
|
||||
|
||||
# Link local mermaid to npm
|
||||
pushd packages/mermaid
|
||||
npm link
|
||||
popd
|
||||
|
||||
# Clone the Mermaid Live Editor repository
|
||||
git clone https://github.com/mermaid-js/mermaid-live-editor.git
|
||||
|
||||
# Change to the repository directory
|
||||
cd mermaid-live-editor
|
||||
|
||||
# Link local mermaid to live editor
|
||||
npm link mermaid
|
||||
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Build the site
|
||||
npm run build
|
Reference in New Issue
Block a user