concept-collection / commonroom-recorder
commonroom-recorder / .github / workflows / deploy.yml
82 lines · 3.2 KBBlameHistoryRaw
1# Build the package and publish the npm-pack tarball to GitHub Pages, so the
2# recorder can be run with npx straight from the Pages URL — no npm registry:
3#
4# npx https://concept-collection.github.io/commonroom-recorder/commonroom-recorder.tgz <room>
6name: deploy
8on:
9 push:
10 branches: [main]
11 workflow_dispatch:
13permissions:
14 contents: read
15 pages: write
16 id-token: write
18concurrency:
19 group: pages
20 cancel-in-progress: false
22jobs:
23 build:
24 runs-on: ubuntu-latest
25 steps:
26 - uses: actions/checkout@v4
27 - uses: actions/setup-node@v4
28 with:
29 node-version: 22
30 - run: npm ci # its prepare script builds dist/
31 - name: Pack tarball and build site
32 run: |
33 mkdir -p site
34 npm pack --pack-destination site
35 cp site/commonroom-recorder-*.tgz site/commonroom-recorder.tgz
36 cat > site/index.html <<'EOF'
37 <!DOCTYPE html>
38 <html lang="en">
39 <head>
40 <meta charset="utf-8">
41 <meta name="viewport" content="width=device-width, initial-scale=1">
42 <title>commonroom-recorder</title>
43 <style>
44 body { font-family: system-ui, sans-serif; max-width: 42rem; margin: 3rem auto; padding: 0 1rem; line-height: 1.5; }
45 pre { background: #f4f4f4; padding: 0.75rem 1rem; border-radius: 6px; overflow-x: auto; }
46 @media (prefers-color-scheme: dark) { body { background: #1a1a1a; color: #ddd; } pre { background: #2a2a2a; } a { color: #8ab4f8; } }
47 </style>
48 </head>
49 <body>
50 <h1>commonroom-recorder</h1>
51 <p>Record a <a href="https://concept-collection.github.io/commonroom/">commonroom</a>
52 call from the command line: per-participant WAV files plus the room chat,
53 for transcribing the meeting. Needs Node &ge; 22.</p>
54 <pre>npx https://concept-collection.github.io/commonroom-recorder/commonroom-recorder.tgz record &lt;room&gt;</pre>
55 <p>Add <code>--transcribe</code> to grow a speaker-attributed transcript live
56 during the meeting (needs <code>pip install faster-whisper</code>), or create one
57 afterwards:</p>
58 <pre>npx https://concept-collection.github.io/commonroom-recorder/commonroom-recorder.tgz transcribe &lt;recording-dir&gt;</pre>
59 <p>Stop recording with Ctrl-C. See the
60 <a href="https://github.com/concept-collection/commonroom-recorder">README</a>
61 for options and output format.</p>
62 <p><small>npx caches the download per URL; to pick up a newer version, use the
63 versioned tarball
64 (<a href="commonroom-recorder-__VERSION__.tgz">commonroom-recorder-__VERSION__.tgz</a>,
65 currently __VERSION__) or <code>rm -rf ~/.npm/_npx</code>.</small></p>
66 </body>
67 </html>
68 EOF
69 sed -i "s/__VERSION__/$(node -p 'require("./package.json").version')/g" site/index.html
70 - uses: actions/upload-pages-artifact@v3
71 with:
72 path: site
74 deploy:
75 needs: build
76 runs-on: ubuntu-latest
77 environment:
78 name: github-pages
79 url: ${{ steps.deployment.outputs.page_url }}
80 steps:
81 - id: deployment
82 uses: actions/deploy-pages@v4