chore: build dev branch docs as well

This commit is contained in:
bd_ 2023-03-25 14:22:48 +09:00
parent f3a2aa987b
commit 8ead8bd8c5
3 changed files with 46 additions and 4 deletions

View File

@ -3,6 +3,19 @@
on: on:
pull_request: pull_request:
workflow_call: 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: jobs:
build-docs: build-docs:
@ -13,6 +26,11 @@ jobs:
with: with:
node-version: 18 node-version: 18
- uses: actions/checkout@v3 # check out this repo - 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 - uses: actions/checkout@v3
with: with:
repository: bdunderscore/modular-avatar-images repository: bdunderscore/modular-avatar-images
@ -38,15 +56,20 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ 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 - name: Build docs
run: | run: |
cd docs cd docs
yarn install --immutable yarn install --immutable
yarn build yarn build
ls -lR build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: docs name: ${{ inputs.artifact || 'docs' }}
path: docs/build path: docs/build

View File

@ -2,7 +2,9 @@ name: Deploy documentation
on: on:
push: push:
branches: branches:
- ci
- main - main
- dev
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@ -17,10 +19,19 @@ concurrency:
jobs: jobs:
build-docs: build-docs:
name: Build documentation 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: deploy-docs:
name: Deploy documentation name: Deploy documentation
needs: build-docs needs:
- build-docs
- build-docs-dev
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
@ -32,6 +43,14 @@ jobs:
with: with:
name: docs name: docs
path: docs/build 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 - name: Setup Pages
uses: actions/configure-pages@v2 uses: actions/configure-pages@v2

View File

@ -26,7 +26,7 @@ name: GameCI
on: on:
push: 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 # 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 # we assign this action, as we're allowing arbitrary code execution with the context of
# whatever permissions we assign. # whatever permissions we assign.