Repository navigation
67 lines (57 loc) · 1.63 KB
/
Copy pathdocs.yml
File metadata and controls
67 lines (57 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Docs
on:
push:
branches:
- master
paths:
- "docs/**"
- "src/**"
- "scripts/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-26.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: install moon
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: generated pages are up to date
run: |
moon update
moon info --target all
python3 scripts/gen_api.py
python3 scripts/gen_examples.py
git diff --exit-code -- docs/api.html docs/examples.html docs/index.html
# The showcase page sends its requests to this library compiled to
# JavaScript, so the routing it shows is the routing a server runs.
- name: build the playground engine
run: |
moon build --target js --release src/examples/browser
mkdir -p docs/engine
cp _build/js/release/build/examples/browser/browser.js docs/engine/moonapi.js
- name: configure pages
uses: actions/configure-pages@v6
with:
enablement: true
- name: upload the site
uses: actions/upload-pages-artifact@v5
with:
path: docs
- name: deploy
id: deployment
uses: actions/deploy-pages@v5