From 810fe99489bc14a4cc9273bb919e08bc0c68da10 Mon Sep 17 00:00:00 2001 From: Jane Chu <7559015+janechu@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:36:19 -0700 Subject: [PATCH] Add github pages workflow (#6992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request ## 📖 Description This change adds a manually triggerable workflow to deploy the documentation website to github pages. ## 👩‍💻 Reviewer Notes I've updated the docusaurus configuration as part of this pipeline for testing, we will not updated the DNS until v2 has been published. --- .github/workflows/cd-gh-pages.yml | 48 ++++++++++++++++++++++++++++++ package.json | 1 + sites/website/docusaurus.config.js | 6 ++-- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cd-gh-pages.yml diff --git a/.github/workflows/cd-gh-pages.yml b/.github/workflows/cd-gh-pages.yml new file mode 100644 index 00000000000..b37d0cf3a1d --- /dev/null +++ b/.github/workflows/cd-gh-pages.yml @@ -0,0 +1,48 @@ +name: Deploy GitHub Pages + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node: [16.x] + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo '::set-output name=dir::$(yarn cache dir)' + + - name: Set up node_modules cache + uses: actions/cache@v3 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + node_modules + */*/node_modules + key: ${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn_cache- + + - name: Install package dependencies + run: yarn install --frozen-lockfile --ignore-scripts --prefer-offline + + - name: Prepare workspaces + run: yarn prepare + + - name: Build GitHub Pages + run: yarn build:gh-pages + + - name: Deploy GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages # The branch the action should deploy to. + folder: sites/website/build # The folder the action should deploy. + target-folder: docs # The folder on the branch to deploy to. diff --git a/package.json b/package.json index 7b67974e53c..ee2cffefddc 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "change": "beachball change", "checkchange": "beachball check --scope \"!sites/*\" --changehint \"Run 'yarn change' to generate a change file\"", "check": "beachball check ", + "build:gh-pages": "yarn workspace fast-site build", "publish": "beachball publish", "publish-ci": "beachball publish -y --access public", "prepare": "lerna run prepare", diff --git a/sites/website/docusaurus.config.js b/sites/website/docusaurus.config.js index 6dfee912701..57740741caa 100644 --- a/sites/website/docusaurus.config.js +++ b/sites/website/docusaurus.config.js @@ -1,8 +1,10 @@ module.exports = { title: "FAST", tagline: "The adaptive interface system for modern web experiences", - url: "https://www.fast.design", - baseUrl: "/", + url: "https://microsoft.github.io", + baseUrl: "/fast/", + deploymentBranch: "gh-pages", + trailingSlash: false, favicon: "/favicon.ico", organizationName: "microsoft", projectName: "fast",