Skip to content

Deploy GitHub Pages

Deploy GitHub Pages #2

Workflow file for this run

name: Deploy GitHub Pages
on:
workflow_dispatch:
env:
GITHUB_SERVICE_USER: "Microsoft FAST Builds"
GITHUB_SERVICE_EMAIL: "[email protected]"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Set Git User
run: |
git config --global user.name "${{ env.GITHUB_SERVICE_USER }}"
git config --global user.email "${{ env.GITHUB_SERVICE_EMAIL }}"
- 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.