From 8ead8bd8c5cff1de7aae8478f51d0dbcad988c4e Mon Sep 17 00:00:00 2001 From: bd_ Date: Sat, 25 Mar 2023 14:22:48 +0900 Subject: [PATCH] chore: build dev branch docs as well --- .github/workflows/build-test-docs.yml | 25 ++++++++++++++++++++++++- .github/workflows/deploy-pages.yml | 23 +++++++++++++++++++++-- .github/workflows/gameci.yml | 2 +- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-docs.yml b/.github/workflows/build-test-docs.yml index cd0864c1..c7f9b320 100644 --- a/.github/workflows/build-test-docs.yml +++ b/.github/workflows/build-test-docs.yml @@ -3,6 +3,19 @@ on: pull_request: workflow_call: + inputs: + ref: + description: 'commit to build' + type: string + required: false + path: + description: 'path within the docs pages to build to' + type: string + required: false + artifact: + description: 'artifact name to write' + type: string + required: false jobs: build-docs: @@ -13,6 +26,11 @@ jobs: with: node-version: 18 - uses: actions/checkout@v3 # check out this repo + if: ${{ !inputs.ref }} + - uses: actions/checkout@v3 # check out the repo we're building docs for + if: ${{ inputs.ref }} + with: + ref: ${{ inputs.ref }} - uses: actions/checkout@v3 with: repository: bdunderscore/modular-avatar-images @@ -38,15 +56,20 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- + - name: Set baseUri + if: ${{ inputs.path }} + run: | + BASEURL="/${{ inputs.path }}/" perl -i -e "s{baseUrl: '/'}{$ENV{BASEURL}}e" docs/docusaurus.config.js - name: Build docs run: | cd docs yarn install --immutable yarn build + ls -lR build - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: docs + name: ${{ inputs.artifact || 'docs' }} path: docs/build \ No newline at end of file diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index ededb7e3..0102ccea 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -2,7 +2,9 @@ name: Deploy documentation on: push: branches: + - ci - main + - dev workflow_dispatch: permissions: @@ -17,10 +19,19 @@ concurrency: jobs: build-docs: name: Build documentation - uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main + uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@ci + build-docs-dev: + name: Build documentation (dev branch) + uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@ci + with: + ref: dev + path: dev + artifact: docs-dev deploy-docs: name: Deploy documentation - needs: build-docs + needs: + - build-docs + - build-docs-dev environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -32,6 +43,14 @@ jobs: with: name: docs path: docs/build + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: docs-dev + path: docs/build/dev + - name: test + run: | + ls -lR docs/build - name: Setup Pages uses: actions/configure-pages@v2 diff --git a/.github/workflows/gameci.yml b/.github/workflows/gameci.yml index 60526ee8..418502d0 100644 --- a/.github/workflows/gameci.yml +++ b/.github/workflows/gameci.yml @@ -26,7 +26,7 @@ name: GameCI on: push: - branches: [master, dev, ci] + branches: [master, dev] # This is a bit of a radioactive event; we need to be very careful with what permissions # we assign this action, as we're allowing arbitrary code execution with the context of # whatever permissions we assign.