Skip to content

Commit

Permalink
Test github pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
fongsean committed May 14, 2024
1 parent 517fedc commit b92087d
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 77 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Smart Forms Docs Deployment Workflow

on:
push:
# branches: [ "main" ]


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

jobs:
deploy-docusaurus:
environment:
name: github-pages
url: ${{ steps.build-publish.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Build documentation website
run: npm run build -w documentation

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4


# deploy-storybook:
# environment:
# name: github-pages
# url: ${{ steps.build-publish.outputs.page_url }}
#
# runs-on: ubuntu-latest
# steps:
# - uses: bitovi/[email protected]
# with:
# path: packages/smart-forms-renderer/storybook-static
# install_command: npm ci
# build_command: npm run build-storybook -w packages/smart-forms-renderer
25 changes: 0 additions & 25 deletions .github/workflows/deploy_storybook.yml

This file was deleted.

121 changes: 69 additions & 52 deletions documentation/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import * as path from 'path';

const config: Config = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',
title: 'Smart Forms',
tagline: '',
favicon: 'img/logo.svg',

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

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
organizationName: 'aehrc', // Usually your GitHub org/user name.
projectName: 'smart-forms', // Usually your repo name.\
trailingSlash: false,

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
Expand All @@ -26,7 +28,7 @@ const config: Config = {
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
locales: ['en']
},

presets: [
Expand All @@ -37,46 +39,44 @@ const config: Config = {
sidebarPath: './sidebars.ts',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
editUrl: 'https://github.com/aehrc/smart-forms/'
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
editUrl: 'https://github.com/aehrc/smart-forms/'
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
customCss: './src/css/custom.css'
}
} satisfies Preset.Options
]
],

themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Site',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
title: 'Smart Forms',
// logo: {
// alt: 'Smart Forms Logo',
// src: 'img/docusaurus-social-card.jpg'
// },
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
sidebarId: 'gettingStartedSidebar',
position: 'left',
label: 'Tutorial',
label: 'Getting Started'
},
{to: '/blog', label: 'Blog', position: 'left'},
// { to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/aehrc/smart-forms',
label: 'GitHub',
position: 'right',
},
],
position: 'right'
}
]
},
footer: {
style: 'dark',
Expand All @@ -85,49 +85,66 @@ const config: Config = {
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
label: 'Docs',
to: '/docs/intro'
}
]
},
{
title: 'Community',
title: 'Tools',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
label: 'App Dashboard',
href: 'https://smartforms.csiro.au/'
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
label: 'Playground',
href: 'https://smartforms.csiro.au/playground'
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
label: 'Forms Server FHIR API',
href: 'https://smartforms.csiro.au/api/fhir/Questionnaire'
}
]
},
{
title: 'More',
title: 'Resources',
items: [
{
label: 'Blog',
to: '/blog',
label: 'FHIR Implementation Guide',
to: 'https://smartforms.csiro.au/ig'
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
},
],
},
href: 'https://github.com/facebook/docusaurus'
}
]
}
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} Commonwealth Scientific and Industrial Research
- Organisation (CSIRO). Built with Docusaurus.`
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
darkTheme: prismThemes.dracula
}
} satisfies Preset.ThemeConfig,

plugins: [
() => ({
name: 'resolve-react',
configureWebpack() {
return {
resolve: {
alias: {
// assuming root node_modules is up from "./packages/<your-docusaurus>
react: path.resolve('../../node_modules/react')
}
}
};
}
})
]
};

export default config;

0 comments on commit b92087d

Please sign in to comment.