Skip to content

Commit 5f6a0e6

Browse files
devongovettLFDanLu
authored andcommitted
docs: Prepare S2 docs deploy (#8969)
1 parent c508bef commit 5f6a0e6

File tree

3 files changed

+65
-7
lines changed

3 files changed

+65
-7
lines changed

.circleci/config.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,21 @@ jobs:
478478
paths:
479479
- '*/docs/'
480480

481+
docs-beta:
482+
executor: rsp-xlarge
483+
steps:
484+
- restore_cache:
485+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
486+
487+
- run:
488+
name: build docs
489+
command: make s2-docs-production
490+
491+
- persist_to_workspace:
492+
root: dist
493+
paths:
494+
- '*/docs/'
495+
481496
s2-docs:
482497
executor: rsp-xlarge
483498
steps:
@@ -1018,6 +1033,26 @@ workflows:
10181033
requires:
10191034
- docs-production
10201035

1036+
1037+
beta-docs:
1038+
when:
1039+
and:
1040+
- equal: [ "beta-docs", << pipeline.parameters.GHA_Action >> ]
1041+
jobs:
1042+
- install
1043+
- docs-beta:
1044+
filters:
1045+
branches:
1046+
only: beta-docs
1047+
requires:
1048+
- install
1049+
- deploy-production:
1050+
filters:
1051+
branches:
1052+
only: beta-docs
1053+
requires:
1054+
- docs-beta
1055+
10211056
nightly:
10221057
triggers:
10231058
- schedule:

.github/workflows/beta-docs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Beta docs deploy
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
7+
jobs:
8+
trigger-circleci:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Run CircleCI
12+
id: beta-docs
13+
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5
14+
env:
15+
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ website:
109109
website-production:
110110
node scripts/buildWebsite.js $$PUBLIC_URL
111111
cp packages/dev/docs/pages/robots.txt dist/production/docs/robots.txt
112+
# Uncomment this when we are ready to release.
113+
# $(MAKE) s2-docs-production
112114
$(MAKE) starter-zip
113115
$(MAKE) tailwind-starter
114116
$(MAKE) s2-storybook-docs
@@ -143,12 +145,18 @@ s2-api-diff:
143145
node scripts/api-diff.js --skip-same --skip-style-props
144146

145147
s2-docs:
148+
BASE_URL=https://reactspectrum.blob.core.windows.net PUBLIC_URL=/reactspectrum/$$(git rev-parse HEAD)/s2-docs DIST_DIR=dist/$$(git rev-parse HEAD)/s2-docs $(MAKE) build-s2-docs
149+
150+
s2-docs-production:
151+
BASE_URL=https://react-spectrum.adobe.com PUBLIC_URL=/beta DIST_DIR=dist/production/docs/beta $(MAKE) build-s2-docs
152+
153+
build-s2-docs:
146154
yarn workspace @react-spectrum/s2-docs generate:md
147155
yarn workspace @react-spectrum/s2-docs generate:og
148-
REGISTRY_URL=https://reactspectrum.blob.core.windows.net/reactspectrum/$$(git rev-parse HEAD)/s2-docs/registry node scripts/buildRegistry.mjs
149-
REGISTRY_URL=https://reactspectrum.blob.core.windows.net/reactspectrum/$$(git rev-parse HEAD)/s2-docs/registry yarn build:s2-docs --public-url /reactspectrum/$$(git rev-parse HEAD)/s2-docs/
150-
mkdir -p dist/$$(git rev-parse HEAD)
151-
mv packages/dev/s2-docs/dist dist/$$(git rev-parse HEAD)/s2-docs
152-
mkdir -p dist/$$(git rev-parse HEAD)/s2-docs/registry
153-
mv starters/docs/registry dist/$$(git rev-parse HEAD)/s2-docs/registry/vanilla
154-
mv starters/tailwind/registry dist/$$(git rev-parse HEAD)/s2-docs/registry/tailwind
156+
REGISTRY_URL=$(BASE_URL)$(PUBLIC_URL)/registry node scripts/buildRegistry.mjs
157+
REGISTRY_URL=$(BASE_URL)$(PUBLIC_URL)/registry yarn build:s2-docs --public-url $(PUBLIC_URL)
158+
mkdir -p $(DIST_DIR)
159+
mv packages/dev/s2-docs/dist/* $(DIST_DIR)
160+
mkdir -p $(DIST_DIR)/registry
161+
mv starters/docs/registry $(DIST_DIR)/registry/vanilla
162+
mv starters/tailwind/registry $(DIST_DIR)/registry/tailwind

0 commit comments

Comments
 (0)