Skip to content

Commit

Permalink
Deploy all examples that do not require a backend to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisalmen committed Oct 23, 2024
1 parent 64f9110 commit de57870
Show file tree
Hide file tree
Showing 24 changed files with 393 additions and 91 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ghp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Production for GitHub Pages

on:
push:
branches:
- "ghp"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
ghp-build:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Volta
uses: volta-cli/action@v4

- name: Use pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Install
shell: bash
run: |
npm ci
- name: Build
run: |
npm run report:versions
npm run build
- name: Build Production
run: |
npm run production:build
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./packages/examples/production/

ghp-deploy:
needs: ghp-build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
34 changes: 2 additions & 32 deletions .github/workflows/actions.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build
name: Build, Lint and Test

on:
push:
branches:
- '**'
- 'main'
tags-ignore:
- '**'
pull_request:
Expand All @@ -13,10 +13,8 @@ on:

jobs:
build:
name: monaco-languageclient
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref_name != 'verify'

steps:
- name: Checkout
Expand Down Expand Up @@ -52,31 +50,3 @@ jobs:
run: |
npm run report:versions
npm run test:run
- name: Build production
if: github.ref_name == 'main'
shell: bash
run: |
npm run vite:build
verify:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref_name == 'verify'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Volta
uses: volta-cli/action@v4

- name: Use pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Execute verification
shell: bash
run: |
bash ./verify/buildAll.sh
29 changes: 29 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Verification Builds

on:
push:
branches:
- 'verify'
workflow_dispatch:

jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Volta
uses: volta-cli/action@v4

- name: Use pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Execute verification
shell: bash
run: |
bash ./verify/buildAll.sh
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
"webRoot": "${workspaceFolder}",
"userDataDir": "${workspaceFolder}/.vscode/profile"
},
{
"name": "Chrome Preview",
"type": "chrome",
"request": "launch",
"url": "http://localhost:20002",
"webRoot": "${workspaceFolder}/packages/examples/production",
"userDataDir": "${workspaceFolder}/.vscode/profile"
},
{
"type": "node",
"request": "launch",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"terminal.integrated.scrollback": 10000,
"vitest.disableWorkspaceWarning": true
}
8 changes: 5 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ <h3>Multiple Languageclients</h3>
<a href="./packages/examples/two_langauge_clients.html">Json & Python Languageclients & Language Server (Web Socket)</a>
<br>

<h3>TypeScript</h3>
<a href="./packages/examples/ts.html">TypeScript Extension Host Worker</a>
<br>

<h2>Monaco Editor React</h2>
<a href="./packages/examples/react_statemachine.html">React: Langium Statemachine Language Client & Language Server (Worker)</a>
<br>
Expand All @@ -71,9 +75,7 @@ <h2>Monaco Editor React</h2>
<a href="./packages/examples/react_python.html">React: Python Language Client & Language Server (Web Socket)</a>
<br>

<h3>monaco-editor related examples</h3>
<a href="./packages/examples/ts.html">Monaco Editor Wrapper TypeScript Example</a>
<br>
<h3>Staging</h3>
<a href="./packages/examples/files.html">Files Testbed</a>

<h2>Verification</h2>
Expand Down
138 changes: 138 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit de57870

Please sign in to comment.