-
-
Notifications
You must be signed in to change notification settings - Fork 389
52 lines (50 loc) · 1.99 KB
/
docs-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Build and deploy developer docs (oa-docs package)
name: Docs Deploy
on:
push:
branches:
- master
# Only run action if changes have been made
# to the documentation or components packages
paths:
- 'packages/documentation/**'
- 'packages/components/**'
- 'packages/themes/**'
- '.github/workflows/docs-deploy.yml'
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.17.1'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# Setup yarn 2 cache: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Setup Cache
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('packages/documentation/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Populate component storybook docs as static asset to include in overall docs
- name: Build component docs
run: yarn workspace oa-components install --immutable && yarn storybook:build
- name: Copy component docs to storybook
run: mv packages/components/storybook-static packages/documentation/static
# Build and deploy docs
- name: Install npm dependencies
run: yarn workspace oa-docs install --immutable
- name: Set Config
run: cp packages/documentation/docusaurus.config.gh-pages.js packages/documentation/docusaurus.config.js
- name: Build Docs
run: yarn workspace oa-docs build
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/documentation/build