Skip to content

Commit

Permalink
Add github pages workflow (#6992)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
janechu authored Jun 17, 2024
1 parent ebf4605 commit 810fe99
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/cd-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions sites/website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 810fe99

Please sign in to comment.