Skip to content

Add initial docs #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +41,15 @@ jobs:
- name: Run tests
run: npm test

- name: Build documentation
run: npm run build:docs

- name: Upload documentation
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
path: ./dist

- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
Expand All @@ -61,3 +75,15 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: npm publish --access public ./*.tgz --tag experimental

deploy-docs:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/node_modules/
/lib/
.bsb.lock
.astro
dist/
27 changes: 27 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { readFileSync } from "node:fs";
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

const rescriptTM = JSON.parse(
readFileSync("./docs/assets/rescript.tmLanguage.json", "utf-8"),
);

export default defineConfig({
srcDir: "docs",
publicDir: "docs/public",
"site": "https://rescript-lang.github.io/experimental-rescript-webapi",
integrations: [
starlight({
title: "Experimental WebAPI",
logo: {
src: "./docs/assets/rescript-logo.svg",
},
customCss: ["./docs/styles/fonts.css", "./docs/styles/theme.css"],
expressiveCode: {
shiki: {
langs: [rescriptTM],
},
},
}),
],
});
53 changes: 53 additions & 0 deletions docs/assets/rescript-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading