From 08050f4021baadde35ea8b8fa94ff98c11bd7742 Mon Sep 17 00:00:00 2001 From: bd_ Date: Fri, 9 Sep 2022 17:18:35 -0700 Subject: [PATCH] Refactor out docs building logic --- .github/workflows/build-test-docs.yml | 17 ++++++++++---- .../{build-pages.yml => deploy-pages.yml} | 23 +++++++++---------- 2 files changed, 23 insertions(+), 17 deletions(-) rename .github/workflows/{build-pages.yml => deploy-pages.yml} (68%) diff --git a/.github/workflows/build-test-docs.yml b/.github/workflows/build-test-docs.yml index 30323d2b..3100b2b4 100644 --- a/.github/workflows/build-test-docs.yml +++ b/.github/workflows/build-test-docs.yml @@ -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 \ No newline at end of file + npm run build + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: docs + path: docs/build \ No newline at end of file diff --git a/.github/workflows/build-pages.yml b/.github/workflows/deploy-pages.yml similarity index 68% rename from .github/workflows/build-pages.yml rename to .github/workflows/deploy-pages.yml index 3e7a6052..b62d6461 100644 --- a/.github/workflows/build-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -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