modular-avatar/.github/workflows/build-test-docs.yml

52 lines
1.4 KiB
YAML
Raw Normal View History

2022-09-10 08:18:35 +08:00
name: Build documentation
2022-09-09 11:52:06 +08:00
on:
2022-09-10 08:18:35 +08:00
pull_request:
workflow_call:
2022-09-09 11:52:06 +08:00
jobs:
2022-09-10 08:18:35 +08:00
build-docs:
name: Build documentation
2022-09-09 11:52:06 +08:00
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3 # check out this repo
2022-10-23 03:42:02 +08:00
- uses: actions/checkout@v3
with:
repository: bdunderscore/modular-avatar-images
path: modular-avatar-images
- name: Install logo assets
run: |
cp -Rv modular-avatar-images/img/* docs/static/img
2023-02-17 20:03:57 +08:00
- name: Setup yarn 2.0
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(cd docs; yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
2022-09-09 11:52:06 +08:00
- name: Build docs
run: |
cd docs
2023-02-17 20:03:57 +08:00
yarn install --immutable
2022-09-10 08:24:37 +08:00
yarn build
2022-09-10 08:18:35 +08:00
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: docs/build