-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (61 loc) · 1.91 KB
/
website.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
63
64
65
66
67
68
69
70
71
name: "NgRx Essentials website"
env:
NODE_OPTIONS: --max_old_space_size=6144
node-version: 14.x
website-package-name: website
on:
push:
branches:
- main
pull_request: {}
jobs:
build:
name: Build website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Variable-Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Yarn cache directory
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-${{ env.node-version }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ env.node-version }}
${{ runner.os }}
- run: yarn install
- name: Build website
run: yarn build
- name: "Upload website build artifact"
uses: actions/upload-artifact@v4
with:
name: ${{ env.website-package-name }}
path: ./build/
if-no-files-found: error
deploy:
name: Deploy website to GitHub Pages
if: >
github.ref == 'refs/heads/main' && (github.event_name ==
'workflow_dispatch' || github.event_name == 'push')
needs: build
runs-on: ubuntu-latest
env:
package-path: ./static-website/
steps:
# necessary for JamesIves/github-pages-deploy-action
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ env.website-package-name }}
path: ${{ env.package-path }}
- name: Deploy docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
folder: ${{ env.package-path }}