-
Notifications
You must be signed in to change notification settings - Fork 20
71 lines (61 loc) · 1.95 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: "RxJS Fundamentals 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@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.node-version }}
- name: Variable-Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn cache directory
uses: actions/cache@v2
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 }}-yarn-
${{ runner.os }}-node-${{ env.node-version }}-
- run: yarn install
- name: Build website
run: yarn build
- name: "Upload website build artifact"
uses: actions/upload-artifact@v2
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@v2
- uses: actions/download-artifact@v2
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 }}