Skip to content

Commit

Permalink
Add github workflows for deploying the docs website
Browse files Browse the repository at this point in the history
This patch adds basic Github action workflows to help with deploying
the docs website and test the deployment on open PRs.
  • Loading branch information
a-hilaly committed Sep 24, 2024
1 parent a74007a commit 8f6a962
Show file tree
Hide file tree
Showing 5 changed files with 14,594 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy docs

on:
push:
branches:
- main

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v4
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: ./website

- name: Build website
run: bun build
working-directory: ./website

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

deploy:
name: Deploy to GitHub Pages
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./websites/build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
25 changes: 25 additions & 0 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test docs deployment

on:
pull_request:
branches:
- main

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: ./website
- name: Test build website
run: bun build
working-directory: ./website
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ symphony-chart*
.design
.DS_Store
TODO.*
package-lock.json
# package-lock.json
Loading

0 comments on commit 8f6a962

Please sign in to comment.