diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7151754 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,88 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: ["main", "pipeline/hosted-strudel"] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Generate Presentation (Pandoc) + run: | + mkdir _site + docker run --rm -v ${{ github.workspace }}:/data pandoc/core \ + WORKSHOP.md -t revealjs -s -o _site/index.html \ + -V theme=black -V revealjs-url=https://unpkg.com/reveal.js \ + --slide-level=2 --css=doc/custom.css + + - name: Copy Assets + run: | + mkdir -p _site/doc + cp doc/* _site/doc/ + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Install Strudel Dependencies + working-directory: strudel + run: pnpm install + + - name: Build Strudel + working-directory: strudel + env: + STRUDEL_SITE: "https://alienmind.github.io" + STRUDEL_BASE: "/algorave/strudel/" + # We run prebuild (Generate docs etc), then build website + run: | + pnpm run prebuild + cd website + pnpm run build + + - name: Prepare Deployment Artifact + run: | + # Create directory for strudel and copy build result + mkdir -p _site/strudel + cp -r strudel/website/dist/* _site/strudel/ + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: '_site' + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/deploy_slides.yml b/.github/workflows/deploy_slides.yml deleted file mode 100644 index 039bab9..0000000 --- a/.github/workflows/deploy_slides.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Deploy Slides to GitHub Pages - -on: - push: - branches: ["main", "feature/presentation"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: './web/public' - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index adce1e6..97d97d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,14 @@ node_modules .DS_Store +# Generated Documentation & Examples # Generated Documentation & Examples web/public/examples/*.strudel -# web/public/presentation.html +dist/ # Next.js web/.next/ web/out/ web/build/ .next/ +.env \ No newline at end of file diff --git a/README.md b/README.md index 02955a7..5f88fc7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The project is a composite of: This "hub" aims to integrate a conglomerate of useful tools for Algorave: * [**strudel.cc**](https://strudel.cc) - The official Strudel website and player. +* [**Self-hosted Strudel**](https://alienmind.github.io/algorave/strudel/) - The local fork hosted on GitHub Pages. * [**strudel-mcp-server**](https://github.com/williamzujkowski/strudel-mcp-server) - MCP Server for Strudel (local integration) (see also [npm page](https://libraries.io/npm/@williamzujkowski%2Fstrudel-mcp-server)) * [**midi-to-strudel**](https://github.com/alienmind/MIDI-To-Strudel) - Scripts to convert MIDI files to Strudel code. * **Other useful stuff** - More integrations coming soon! diff --git a/WORKSHOP.md b/WORKSHOP.md index 0ee4ec7..03debd0 100644 --- a/WORKSHOP.md +++ b/WORKSHOP.md @@ -6,7 +6,7 @@ A **1-hour workshop** exploring how to create music with code using Strudel. ## đź”— Links -**Strudel**: [https://strudel.cc](https://strudel.cc) +**Strudel**: [https://strudel.cc](https://strudel.cc) || [Self-hosted option](https://alienmind.github.io/algorave/strudel/) (install the PWA for best performance) **Site Gallery / Tutorial**: [https://strudel.patternclub.org/workshop/site-gallery](https://strudel.patternclub.org/workshop/site-gallery) @@ -152,7 +152,7 @@ Add the server to your configuration (~/.gemini/settings.json) Open up side by side: * [MCP Strudel Website](https://mcp-strudel.mcp.mathplosion.com/strudel/) -* Optionally: [Strudel.cc](https://strudel.cc/) - not accessible with ECB laptops +* Optionally: Use my [Strudel.cc fork](https://alienmind.github.io/algorave/strudel/) (or [Official Strudel.cc](https://strudel.cc/) - not accessible with corporate laptops) * Any terminal with Gemini CLI * Pick the session_id from MCP, paste it to LLM as first prompt: "Use session_id: xxxx for Strudel operations" so it can interact with MCP server window diff --git a/docker-compose.yml b/docker-compose.yml index 40dfcf2..6a2275b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,7 +67,7 @@ services: image: pandoc/core volumes: - .:/data - command: [ "WORKSHOP.md", "-t", "revealjs", "-s", "-o", "web/public/presentation.html", "-V", "theme=black", "-V", "revealjs-url=https://unpkg.com/reveal.js", "--slide-level=2", "--css=doc/custom.css" ] + command: [ "WORKSHOP.md", "-t", "revealjs", "-s", "-o", "dist/presentation.html", "-V", "theme=black", "-V", "revealjs-url=https://unpkg.com/reveal.js", "--slide-level=2", "--css=doc/custom.css" ] networks: algorave_network: diff --git a/package.json b/package.json index a0bd08c..3ee5683 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "docker:build-base": "docker build -t algorave/mcp-base:latest -f strudel-mcp-server/Dockerfile strudel-mcp-server", "docker:up": "npm run docker:build-base && docker-compose up --build", "docker:down": "docker-compose down", - "docs": "docker-compose run --rm docs && npm run sync-docs", + "prebuild": "mkdir -p dist", + "docs": "npm run prebuild && docker-compose run --rm docs && npm run sync-docs", "generate-diagram": "node scripts/generate-diagram.js", "sync-docs": "node scripts/sync-docs.js", "sync-examples": "node scripts/sync-examples.js", diff --git a/scripts/sync-docs.js b/scripts/sync-docs.js index e49c426..f12cd8c 100644 --- a/scripts/sync-docs.js +++ b/scripts/sync-docs.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const srcDocDir = path.join(__dirname, '..', 'doc'); -const destPublicDir = path.join(__dirname, '..', 'web', 'public'); +const destPublicDir = path.join(__dirname, '..', 'dist'); const destDocDir = path.join(destPublicDir, 'doc'); function copyFile(src, dest) { diff --git a/strudel b/strudel index 8a37197..8801c45 160000 --- a/strudel +++ b/strudel @@ -1 +1 @@ -Subproject commit 8a3719752fb418ad39a282df527a5cf3774e4e4c +Subproject commit 8801c45df82f10a20ae729c6761880332c82587d diff --git a/web/public/doc/algorave.png b/web/public/doc/algorave.png deleted file mode 100644 index 9ea8346..0000000 Binary files a/web/public/doc/algorave.png and /dev/null differ diff --git a/web/public/doc/architecture.png b/web/public/doc/architecture.png deleted file mode 100644 index d2db984..0000000 Binary files a/web/public/doc/architecture.png and /dev/null differ diff --git a/web/public/doc/codespaces.png b/web/public/doc/codespaces.png deleted file mode 100644 index aed9792..0000000 Binary files a/web/public/doc/codespaces.png and /dev/null differ diff --git a/web/public/doc/custom.css b/web/public/doc/custom.css deleted file mode 100644 index 6aaa7e9..0000000 --- a/web/public/doc/custom.css +++ /dev/null @@ -1,56 +0,0 @@ -/* Custom Reveal.js Overrides */ - -:root { - --r-main-font-size: 24px; - --r-background-color: #000000; -} - -.reveal { - background-color: #000000 !important; -} - -/* .reveal .slides section { - top: 0 !important; Removed to allow centering -} */ - -/* Limit Logo Size */ -img[src*="logo.png"] { - max-height: 200px !important; - width: auto !important; -} - -/* Hide captions */ -.reveal figcaption { - display: none !important; -} - -/* Adjust heading sizes */ -.reveal h1 { - font-size: 2em; -} - -.reveal h2 { - font-size: 1.5em; -} - -.reveal h3 { - font-size: 1.25em; -} - -/* Code block size and centering */ -.reveal pre { - margin: 20px auto !important; - box-shadow: none !important; -} - -.reveal pre code { - font-size: 0.8em; - max-height: 500px; -} - -/* Center lists relative to slide, but keep content left-aligned */ -.reveal ul, -.reveal ol { - display: inline-block; - text-align: left; -} \ No newline at end of file diff --git a/web/public/doc/gemini.png b/web/public/doc/gemini.png deleted file mode 100644 index db957db..0000000 Binary files a/web/public/doc/gemini.png and /dev/null differ diff --git a/web/public/doc/logo.png b/web/public/doc/logo.png deleted file mode 100644 index 7e228b1..0000000 Binary files a/web/public/doc/logo.png and /dev/null differ diff --git a/web/public/doc/meme.png b/web/public/doc/meme.png deleted file mode 100644 index f44afef..0000000 Binary files a/web/public/doc/meme.png and /dev/null differ diff --git a/web/public/doc/presentation.html b/web/public/doc/presentation.html deleted file mode 100644 index 7d36429..0000000 --- a/web/public/doc/presentation.html +++ /dev/null @@ -1,545 +0,0 @@ - - -
- - - - -