Skip to content

Commit

Permalink
ci(docs): Add workflows for deploying to Github Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnatamo committed Jul 28, 2024
1 parent 6fb6073 commit ed29e67
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Deploy docs to Github Pages

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

defaults:
run:
working-directory: docs/

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: lts/*
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

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
id: deployment
uses: actions/deploy-pages@v4
35 changes: 35 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Test docs

on:
pull_request:
branches:
- main
paths:
- 'docs/**'

defaults:
run:
working-directory: ./docs/

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm

- name: Install dependencies
run: npm ci

- name: Build website
run: npm run build

0 comments on commit ed29e67

Please sign in to comment.