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: on:
pull_request: pull_request:
workflow_call:
jobs: jobs:
test-docs: build-docs:
name: Test documentation name: Build documentation
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
@ -17,4 +18,10 @@ jobs:
run: | run: |
cd docs cd docs
npm install 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: on:
push: push:
branches: branches:
@ -16,22 +16,21 @@ concurrency:
jobs: jobs:
build-docs: 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: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest 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 steps:
run: | - name: Download artifact
cd docs uses: actions/download-artifact@v2
npm install with:
npm run build name: docs
path: docs/build
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v2 uses: actions/configure-pages@v2