Skip to content
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
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check formatting
run: pnpm format:check

- name: Typecheck
run: pnpm typecheck

- name: Build
run: pnpm build

- name: Upload Pages artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v5
with:
path: ./build

deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: pages
cancel-in-progress: false
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
51 changes: 0 additions & 51 deletions .github/workflows/deploy.yml

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build
.docusaurus
pnpm-lock.yaml
src/openapi.json
docs/rpc
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
# Website
# xch.dev

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
Source for [xch.dev](https://xch.dev), the documentation for Sage and the Chia Wallet SDK. It's built with [Docusaurus](https://docusaurus.io/).

### Installation
## Requirements

```
pnpm install
```
- Node.js 24 (see `.nvmrc`; 20 or newer works)
- pnpm, at the version pinned in `package.json`'s `packageManager` field. Running `corepack enable` picks it up automatically.

### Local Development
## Development

```
```sh
pnpm install
pnpm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
`pnpm start` and `pnpm build` both generate the RPC reference pages first. The generated pages go to `docs/rpc`, which is gitignored. To regenerate them on their own, run `pnpm gen-api-docs`.

### Build
Before opening a PR, run:

```
```sh
pnpm format:check # or `pnpm format` to fix
pnpm typecheck
pnpm build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
CI runs the same checks on every pull request.

## RPC reference

The RPC pages are generated from `src/openapi.json`, which comes from Sage. To update it to a Sage release (this needs git and a Rust toolchain):

```sh
pnpm sync-openapi v0.13.1 # omit the tag to use the latest release
```

To use a local Sage checkout instead, set `SAGE_DIR=/path/to/sage`.

## Deployment

Every push to `main` builds the site and deploys it to GitHub Pages through `.github/workflows/ci.yml`.
Loading
Loading