Skip to content

Commit

Permalink
Merge pull request #37 from bloxbean/docs_site
Browse files Browse the repository at this point in the history
Documentation site setup with Github action
  • Loading branch information
satran004 authored May 6, 2024
2 parents b88f89e + 8d9741e commit b8c3dad
Show file tree
Hide file tree
Showing 18 changed files with 8,421 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy to GitHub Pages

on:
push:
tags:
- 'rel-docs*'

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: "./docs/yarn.lock"

- name: Install dependencies
run: |
cd docs
yarn install --frozen-lockfile
- name: Build website
run: |
cd docs
yarn export
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./docs/out
cname: devkit.yaci.xyz
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
# user_name: github-actions[bot]
# user_email: 41898282+github-actions[bot]@users.noreply.github.com
27 changes: 27 additions & 0 deletions .github/workflows/docs-test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test deployment

on:
pull_request:
branches:
- main
- develop
jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: "./docs/yarn.lock"

- name: Install dependencies
run: |
cd docs
yarn install --frozen-lockfile
- name: Test build website
run: |
cd docs
yarn export
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
scripts/scala/*.sc
/docs/node_modules/
/docs/.next
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Yaci DevKit Documentation

6 changes: 6 additions & 0 deletions docs/components/counters.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.counter {
border: 1px solid #ccc;
border-radius: 5px;
padding: 2px 6px;
margin: 12px 0 0;
}
24 changes: 24 additions & 0 deletions docs/components/counters.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Example from https://beta.reactjs.org/learn

import { useState } from 'react'
import styles from './counters.module.css'

function MyButton() {
const [count, setCount] = useState(0)

function handleClick() {
setCount(count + 1)
}

return (
<div>
<button onClick={handleClick} className={styles.counter}>
Clicked {count} times
</button>
</div>
)
}

export default function MyApp() {
return <MyButton />
}
5 changes: 5 additions & 0 deletions docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
11 changes: 11 additions & 0 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
})

module.exports = {
...withNextra(),
images: {
unoptimized: true,
}
}
Loading

0 comments on commit b8c3dad

Please sign in to comment.