Skip to content

Commit

Permalink
docs: add gh pages deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
ephrimlawrence committed Apr 26, 2024
1 parent 8f296a4 commit 7123867
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- gh-pages
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm clean-install
- name: Build website
run: npm build

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

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 5 additions & 2 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ const config: Config = {

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'ephrimawrence/ananse', // Usually your GitHub org/user name.
organizationName: 'github.com/ephrimawrence', // Usually your GitHub org/user name.
projectName: 'ananse', // Usually your repo name.
deploymentBranch: "gh-pages",
trailingSlash: false,

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',


// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
Expand Down Expand Up @@ -73,7 +76,7 @@ const config: Config = {
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Guide',
label: 'Docs',
},
// { to: '/blog', label: 'Blog', position: 'left' },
{
Expand Down

0 comments on commit 7123867

Please sign in to comment.