diff --git a/.circleci/config.yml b/.circleci/config.yml index b7665dbc8f5..8e55af664ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -478,6 +478,21 @@ jobs: paths: - '*/docs/' + docs-beta: + executor: rsp-xlarge + steps: + - restore_cache: + key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + + - run: + name: build docs + command: make s2-docs-production + + - persist_to_workspace: + root: dist + paths: + - '*/docs/' + s2-docs: executor: rsp-xlarge steps: @@ -1018,6 +1033,26 @@ workflows: requires: - docs-production + + beta-docs: + when: + and: + - equal: [ "beta-docs", << pipeline.parameters.GHA_Action >> ] + jobs: + - install + - docs-beta: + filters: + branches: + only: beta-docs + requires: + - install + - deploy-production: + filters: + branches: + only: beta-docs + requires: + - docs-beta + nightly: triggers: - schedule: diff --git a/.github/workflows/beta-docs.yaml b/.github/workflows/beta-docs.yaml new file mode 100644 index 00000000000..5ecf301ef2c --- /dev/null +++ b/.github/workflows/beta-docs.yaml @@ -0,0 +1,15 @@ +name: Beta docs deploy +on: + release: + types: [published] + workflow_dispatch: + +jobs: + trigger-circleci: + runs-on: ubuntu-latest + steps: + - name: Run CircleCI + id: beta-docs + uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5 + env: + CCI_TOKEN: ${{ secrets.CCI_TOKEN }} diff --git a/Makefile b/Makefile index b73134edfeb..ff0cea55c58 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,8 @@ website: website-production: node scripts/buildWebsite.js $$PUBLIC_URL cp packages/dev/docs/pages/robots.txt dist/production/docs/robots.txt + # Uncomment this when we are ready to release. + # $(MAKE) s2-docs-production $(MAKE) starter-zip $(MAKE) tailwind-starter $(MAKE) s2-storybook-docs @@ -144,12 +146,18 @@ s2-api-diff: node scripts/api-diff.js --skip-same --skip-style-props s2-docs: + 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 + +s2-docs-production: + BASE_URL=https://react-spectrum.adobe.com PUBLIC_URL=/beta DIST_DIR=dist/production/docs/beta $(MAKE) build-s2-docs + +build-s2-docs: yarn workspace @react-spectrum/s2-docs generate:md yarn workspace @react-spectrum/s2-docs generate:og - REGISTRY_URL=https://reactspectrum.blob.core.windows.net/reactspectrum/$$(git rev-parse HEAD)/s2-docs/registry node scripts/buildRegistry.mjs - 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/ - mkdir -p dist/$$(git rev-parse HEAD) - mv packages/dev/s2-docs/dist dist/$$(git rev-parse HEAD)/s2-docs - mkdir -p dist/$$(git rev-parse HEAD)/s2-docs/registry - mv starters/docs/registry dist/$$(git rev-parse HEAD)/s2-docs/registry/vanilla - mv starters/tailwind/registry dist/$$(git rev-parse HEAD)/s2-docs/registry/tailwind + REGISTRY_URL=$(BASE_URL)$(PUBLIC_URL)/registry node scripts/buildRegistry.mjs + REGISTRY_URL=$(BASE_URL)$(PUBLIC_URL)/registry yarn build:s2-docs --public-url $(PUBLIC_URL) + mkdir -p $(DIST_DIR) + mv packages/dev/s2-docs/dist/* $(DIST_DIR) + mkdir -p $(DIST_DIR)/registry + mv starters/docs/registry $(DIST_DIR)/registry/vanilla + mv starters/tailwind/registry $(DIST_DIR)/registry/tailwind