Skip to content

Commit 53a01e1

Browse files
committed
Build docs during CI
1 parent 1ed576d commit 53a01e1

File tree

8 files changed

+50
-62
lines changed

8 files changed

+50
-62
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
1116
jobs:
1217
build:
1318
runs-on: ubuntu-latest
@@ -36,6 +41,15 @@ jobs:
3641
- name: Run tests
3742
run: npm test
3843

44+
- name: Build documentation
45+
run: npm run build:docs
46+
47+
- name: Upload documentation
48+
uses: actions/upload-pages-artifact@v3
49+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
50+
with:
51+
path: ./dist
52+
3953
- name: get-npm-version
4054
id: package-version
4155
uses: martinbeentjes/[email protected]
@@ -61,3 +75,15 @@ jobs:
6175
env:
6276
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
6377
run: npm publish --access public ./*.tgz --tag experimental
78+
79+
deploy-docs:
80+
needs: build
81+
runs-on: ubuntu-latest
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
86+
steps:
87+
- name: Deploy to GitHub Pages
88+
id: deployment
89+
uses: actions/deploy-pages@v4

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const rescriptTM = JSON.parse(
99
export default defineConfig({
1010
srcDir: "docs",
1111
publicDir: "docs/public",
12+
"site": "https://rescript-lang.github.io/experimental-rescript-webapi",
1213
integrations: [
1314
starlight({
1415
title: "Experimental WebAPI",

docs/content/docs/philosophy.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ Any other conversions can be performed using the `Prelude.unsafeConversation` he
5353
let element: element = document->Document.createElement( ~localName = "div")
5454
// This is potentially unsafe, as the type system cannot guarantee the conversion
5555
let divElement: htmlDivElement = element->Prelude.unsafeConversation
56-
```
56+
```

docs/content/docs/project-status.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ It might be a little daunting and rough to jump right in.
2525
## Future
2626

2727
Our goal is to make this a true community project. Consumers of the bindings should be able to contribute back to the project with minimal hassle.
28-
This means that the project should be easy to understand and contribute to. Once a contribution is accepted, a new release will follow shortly.
28+
This means that the project should be easy to understand and contribute to. Once a contribution is accepted, a new release will follow shortly.

docs/notes.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

docs/styles/theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ https://github.com/rescript-lang/rescript-lang.org/blob/4e4f9520f6fc7a0376db82a0
1313
--sl-color-accent-low: #4a0f14;
1414
--sl-color-accent: #e6484f;
1515
--sl-color-accent-high: #f9d5d7;
16-
--sl-color-bg-nav: rgb(20, 22, 44);
16+
--sl-color-bg-nav: rgb(20, 22, 44);
1717

1818
& starlight-theme-select {
1919
--sl-color-gray-1: var(--sl-color-black);

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"test": "node tests/index.js",
3131
"build": "rewatch",
3232
"format": "rescript format -all && prettier --write ./docs ./tests/index.js ./package.json",
33-
"docs": "astro dev"
33+
"docs": "astro dev",
34+
"build:docs": "astro build"
3435
},
3536
"license": "MIT",
3637
"dependencies": {
@@ -39,6 +40,7 @@
3940
"devDependencies": {
4041
"@astrojs/starlight": "^0.29.0",
4142
"astro": "^4.16.10",
43+
"prettier": "^3.3.3",
4244
"sharp": "^0.32.5"
4345
}
4446
}

0 commit comments

Comments
 (0)