Skip to content

Commit

Permalink
Build & deploy docs at CI time
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb authored Jul 21, 2024
1 parent 938fdaf commit fbf4b5a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2,447 deletions.
39 changes: 34 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,46 @@ on:
- pull_request
jobs:
test:
name: Node.js ${{ matrix.node-version }}
name: Test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 16
- 20
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- run: npm test

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm run docs
- uses: actions/upload-pages-artifact@v3
with:
path: "./output"

deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
output/
node_modules
package-lock.json
yarn.lock
Loading

0 comments on commit fbf4b5a

Please sign in to comment.