Skip to content

Commit 870e435

Browse files
committed
github pages
1 parent 5893f89 commit 870e435

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy Playground to GitHub Pages
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
26+
- uses: nicholasgasior/setup-tinygo@v1
27+
with:
28+
tinygo-version: 0.35.0
29+
30+
- name: Build WASM artifacts
31+
run: |
32+
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -trimpath -o gnata.wasm ./wasm/
33+
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" wasm_exec.js
34+
tinygo build -o gnata-lsp.wasm -no-debug -gc=conservative -target wasm ./editor/
35+
cp "$(tinygo env TINYGOROOT)/targets/wasm_exec.js" lsp-wasm_exec.js
36+
37+
- name: Prepare site
38+
run: |
39+
mkdir -p _site
40+
cp playground.html _site/index.html
41+
cp gnata.wasm gnata-lsp.wasm wasm_exec.js lsp-wasm_exec.js _site/
42+
43+
- uses: actions/upload-pages-artifact@v3
44+
45+
deploy:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deploy.outputs.page_url }}
51+
steps:
52+
- id: deploy
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)