Skip to content

Commit

Permalink
Merge pull request #10 from ceramicnetwork/github-deploy
Browse files Browse the repository at this point in the history
Build and deploy to GitHub pages
  • Loading branch information
JustinaPetr authored Nov 9, 2023
2 parents 05acbdd + edb32ba commit 92a280d
Show file tree
Hide file tree
Showing 4 changed files with 3,252 additions and 3,410 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build docs
on:
pull_request:
branches:
- main

jobs:
build:
name: Build docs website
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
id: pnpm-install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies and build
run: pnpm install --frozen-lockfile

- name: Build docs website
run: pnpm build
54 changes: 54 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy docs
on:
push:
branches:
- main
workflow_dispatch: # manually triggered

jobs:
deploy:
name: Deploy docs to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
id: pnpm-install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies and build
run: pnpm install --frozen-lockfile

- name: Build docs website
run: pnpm build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
40 changes: 18 additions & 22 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const lightCodeTheme = require('prism-react-renderer/themes/github')
const darkCodeTheme = require('prism-react-renderer/themes/dracula')

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Ceramic documentation',
tagline: 'Ceramic is a decentralized data network that powers an ecosystem of interoperable Web3 applications and services.',
tagline:
'Ceramic is a decentralized data network that powers an ecosystem of interoperable Web3 applications and services.',
favicon: 'img/favicon.png',

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
url: 'https://ceramicnetwork.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl: '/docs-docusaurus/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'Ceramic', // Usually your GitHub org/user name.
projectName: 'ceramicnetwork', // Usually your repo name.
organizationName: 'ceramicnetwork', // Usually your GitHub org/user name.
projectName: 'docs-docusaurus', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
Expand Down Expand Up @@ -71,39 +72,35 @@ const config = {
items: [
{
to: 'docs/composedb/getting-started',
label: 'ComposeDB'
label: 'ComposeDB',
},
{
to: "docs/wheel/wheel-reference",
label: "Wheel",
to: 'docs/wheel/wheel-reference',
label: 'Wheel',
},
{
to: "docs/dids/introduction",
label: "Decentralized Identifiers",
to: 'docs/dids/introduction',
label: 'Decentralized Identifiers',
},
],
},
{

label: 'Protocol',

items: [
{
to: 'docs/protocol/js-ceramic/overview',
label: 'JS-Ceramic'
label: 'JS-Ceramic',
},
],



},
{
label: 'Ecosystem',

items: [
{
to: 'docs/ecosystem/community',
label: "Overview"
label: 'Overview',
},
{
href: 'https://threebox.notion.site/threebox/Ceramic-Ecosystem-Directory-a3a7a58f81544d33ad3feb84368775d4',
Expand Down Expand Up @@ -144,7 +141,6 @@ const config = {
label: 'Protocol',
to: '/docs/protocol/js-ceramic/overview',
},

],
},
{
Expand Down Expand Up @@ -177,7 +173,7 @@ const config = {
},
{
label: 'CIPs',
href: 'https://forum.ceramic.network/c/cips/12'
href: 'https://forum.ceramic.network/c/cips/12',
},
],
},
Expand All @@ -189,6 +185,6 @@ const config = {
darkTheme: darkCodeTheme,
},
}),
};
}

module.exports = config;
module.exports = config
Loading

0 comments on commit 92a280d

Please sign in to comment.