-
Notifications
You must be signed in to change notification settings - Fork 601
62 lines (51 loc) · 1.71 KB
/
cd-gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
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: Cache multiple paths
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install package dependencies
run: npm ci
- name: Build workspaces
run: npm run build
- name: Build GitHub Pages
run: npm run 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.