Skip to content

Commit

Permalink
Merge pull request #770 from TypeFox/ghp
Browse files Browse the repository at this point in the history
GitHub Pages for examples without backend
  • Loading branch information
kaisalmen authored Oct 23, 2024
2 parents 296bb89 + b611186 commit c2659cf
Show file tree
Hide file tree
Showing 24 changed files with 425 additions and 93 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
}
25 changes: 20 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@ <h3>Langium</h3>
<br>
<a href="./packages/examples/statemachine.html">Langium Statemachine Client & Language Server (Worker)</a>
<br>
Localizations: <a href="./packages/examples/statemachine.html?locale=de">German</a> <a href="./packages/examples/statemachine.html?locale=fr">French</a> and <a href="./packages/examples/statemachine.html?locale=es">Spanish</a><br>
Localizations:
<a href="./packages/examples/statemachine.html?locale=cs">cs</a> -
<a href="./packages/examples/statemachine.html?locale=de">de</a> -
<a href="./packages/examples/statemachine.html?locale=es">es</a> -
<a href="./packages/examples/statemachine.html?locale=fr">fr</a> -
<a href="./packages/examples/statemachine.html?locale=it">it</a> -
<a href="./packages/examples/statemachine.html?locale=ja">ja</a> -
<a href="./packages/examples/statemachine.html?locale=ko">ko</a> -
<a href="./packages/examples/statemachine.html?locale=pl">pl</a> -
<a href="./packages/examples/statemachine.html?locale=pt-br">pt-br</a> -
<a href="./packages/examples/statemachine.html?locale=qps-ploc">qps-ploc</a> -
<a href="./packages/examples/statemachine.html?locale=ru">ru</a> -
<a href="./packages/examples/statemachine.html?locale=tr">tr</a> -
<a href="./packages/examples/statemachine.html?locale=zh-hans">zh-hans</a> -
<a href="./packages/examples/statemachine.html?locale=zh-hant">zh-hant</a>
<br>

<h3>Python</h3>
Please execute <b><code>npm run start:example:server:python</code></b> beforehand:<br>
Expand All @@ -63,6 +78,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,10 +90,6 @@ <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>

<h2>Verification</h2>
<h3>Angular</h2>
Please start <b><code>cd verify/angular && npm run verify</code></b> beforehand:<br>
Expand Down
Loading

0 comments on commit c2659cf

Please sign in to comment.