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 7688069
Show file tree
Hide file tree
Showing 5 changed files with 14,600 additions and 3 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy docs

on:
push:
branches:
- main

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./website
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
defaults:
run:
working-directory: ./website
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'
26 changes: 26 additions & 0 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test docs deployment

on:
pull_request:
branches:
- main

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./website
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install --frozen-lockfile
- name: Test build website
run: npm run build
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 7688069

Please sign in to comment.