Skip to content

Commit

Permalink
Add workflow to deploy Docusaurus (#209)
Browse files Browse the repository at this point in the history
* Delete jekyll.yml

No longer needed since we've moved to Docusaurus as our static site generator.

* Create deploy.yml

* Create test-deploy.yml

* Create package-lock.json

Necessary for building the Docusaurus-based site.

* Update .gitignore

Added Docusaurus-related files and folders. Removed Jekyll-related files and folders.
  • Loading branch information
josh-wong authored Apr 16, 2024
1 parent 2b782fc commit 1586266
Show file tree
Hide file tree
Showing 5 changed files with 15,009 additions and 79 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
# 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
workflow_dispatch:

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 ci
- name: Build website
run: npm run 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
64 changes: 0 additions & 64 deletions .github/workflows/jekyll.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test deployment

on:
pull_request:
branches:
- main
# 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
workflow_dispatch:

jobs:
test-deploy:
name: Test deployment
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 ci
- name: Test build website
run: npm run build
20 changes: 5 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
# Node.js and NPM
node_modules
npm-debug.log*
package-lock.json
codekit-config.json

# macOS
.DS_Store
# Dependencies
/node_modules

# Gradle build files
.gradle

# IntelliJ IDEA
.idea
# Production
/build

# Docusaurus-generated files
# Generated files
.docusaurus
.cache-loader
/build

# Misc
.DS_Store
Expand Down
Loading

0 comments on commit 1586266

Please sign in to comment.