Skip to content

Deploy GitHub Pages

Deploy GitHub Pages #4

Workflow file for this run

name: Deploy GitHub Pages
on:
workflow_dispatch:
env:
GITHUB_SERVICE_USER: "Microsoft FAST Builds"
GITHUB_SERVICE_EMAIL: "[email protected]"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- 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:
token: ${{ secrets.GH_TOKEN }}
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.
clean: true # Remove old files to clean up unique hash files.
single-commit: true # Only use a single commit to keep the branch free from git history.