Refactor out docs building logic

This commit is contained in:
bd_ 2022-09-09 17:18:35 -07:00
parent ebabad6550
commit 08050f4021
2 changed files with 23 additions and 17 deletions

View File

@ -1,11 +1,12 @@
name: Test documentation
name: Build documentation
on:
pull_request:
pull_request:
workflow_call:
jobs:
test-docs:
name: Test documentation
build-docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
@ -17,4 +18,10 @@ jobs:
run: |
cd docs
npm install
npm run build
npm run build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: docs/build

View File

@ -1,4 +1,4 @@
name: Build documentation
name: Deploy documentation
on:
push:
branches:
@ -16,22 +16,21 @@ concurrency:
jobs:
build-docs:
name: build-docs
name: Build documentation
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
deploy-docs:
needs: build-docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3 # check out this repo
- name: Build docs
run: |
cd docs
npm install
npm run build
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: docs
path: docs/build
- name: Setup Pages
uses: actions/configure-pages@v2