Skip to content

Commit

Permalink
ci: add deploy workflow for docusaurus github pages (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
onursabanoglu authored Mar 11, 2024
1 parent ee61092 commit a516aca
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Docusaurus to GitHub Pages

on:
push:
branches:
- main
paths:
- 'website/**'

permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install Dependencies and Build
run: |
cd website
npm install
npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

publish_dir: ./website/build
18 changes: 16 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@

dist
node_modules
# Dependencies
/node_modules
/website/node_modules

# Production
/dist
/website/build

# Generated files
/website/.docusaurus

# IDE
.vscode/
.idea/

.DS_Store
5 changes: 3 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { themes as prismThemes } from 'prism-react-renderer';
const config = {
title: 'Frame Design System Documentation',
tagline: 'Guides and docs for Frame Design System',
url: 'http://framedesignsystem.com/',
baseUrl: '/',
url: 'https://parasutcom.github.io/',
baseUrl: '/frame-design-system/',
favicon: 'img/favicon.ico',
organizationName: 'parasutcom',
projectName: 'frame-design-system',
Expand All @@ -15,6 +15,7 @@ const config = {
defaultLocale: 'en',
locales: ['en'],
},
deploymentBranch: 'gh-pages',

themes: ['@docusaurus/theme-live-codeblock'],

Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default function Home() {
const history = useHistory();

useEffect(() => {
history.push('/get-started/introduction');
history.push('/frame-design-system/get-started/introduction');
}, [history]);
}

0 comments on commit a516aca

Please sign in to comment.