Skip to content

Commit 8737a70

Browse files
authored
Add GitHub Actions workflow to deploy playground to GitHub Pages (#14)
* Add GitHub Actions workflow to deploy playground to GitHub Pages * Add Playground Example section to README.md
1 parent 1976648 commit 8737a70

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy Playground
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
7+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
14+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build UMD bundle
36+
run: npm run build:umd
37+
38+
- name: Prepare playground files
39+
run: |
40+
mkdir -p _site/dist
41+
cp samples/language-service-sample/index.html _site/
42+
cp samples/language-service-sample/app.js _site/
43+
cp samples/language-service-sample/styles.css _site/
44+
cp dist/bundle.js _site/dist/
45+
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v5
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: '_site'
53+
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs: build
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ Parser.evaluate('6 * x', { x: 7 }) // 42
5555
- **Object Construction** - Create objects and arrays in expressions
5656
- **Language Service** - IDE integration with completions, hover info, and highlighting
5757

58+
## Playground Example
59+
60+
Try out the expression evaluator and its language server capabilities directly in your browser at the [Playground](https://pro-fa.github.io/expr-eval/). The playground provides an interactive environment with:
61+
- Live expression evaluation
62+
- Code completions and IntelliSense
63+
- Syntax highlighting
64+
- Hover information for functions and variables
65+
5866
## Running Tests
5967

6068
```bash

0 commit comments

Comments
 (0)