Skip to content

Commit bc3aea6

Browse files
authored
Update node.js.yml
1 parent 2e9e915 commit bc3aea6

1 file changed

Lines changed: 26 additions & 45 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,37 @@
1-
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github
3-
4-
name: Node.js CI
1+
name: Deploy to GitHub Pages
52

63
on:
74
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
5+
branches: [master]
6+
paths: [website/**]
117

128
jobs:
13-
checks:
14-
if: github.event_name != 'push'
9+
deploy:
10+
name: Deploy to GitHub Pages
1511
runs-on: ubuntu-latest
1612
steps:
17-
- uses: actions/checkout@v1
18-
- uses: actions/setup-node@v1
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
1915
with:
20-
node-version: '12.x'
21-
- name: Test Build
16+
node-version: 14.x
17+
cache: yarn
18+
- name: Build website
19+
working-directory: website
2220
run: |
23-
if [ -e yarn.lock ]; then
24-
yarn install --frozen-lockfile
25-
elif [ -e package-lock.json ]; then
26-
npm ci
27-
else
28-
npm i
29-
fi
21+
yarn install --frozen-lockfile
3022
yarn build
31-
gh-release:
32-
if: github.event_name != 'pull_request'
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v1
36-
- uses: actions/setup-node@v1
37-
with:
38-
node-version: '12.x'
39-
- uses: webfactory/ssh-agent@v0.5.0
23+
24+
# Popular action to deploy to GitHub Pages:
25+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
26+
- name: Deploy to GitHub Pages
27+
uses: peaceiris/actions-gh-pages@v3
4028
with:
41-
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
42-
- name: Release to GitHub Pages
43-
env:
44-
USE_SSH: true
45-
GIT_USER: git
46-
run: |
47-
git config --global user.email "actions@github.com"
48-
git config --global user.name "gh-actions"
49-
if [ -e yarn.lock ]; then
50-
yarn install --frozen-lockfile
51-
elif [ -e package-lock.json ]; then
52-
npm ci
53-
else
54-
npm i
55-
fi
56-
yarn deploy
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
# Build output to publish to the `gh-pages` branch:
31+
publish_dir: ./website/build
32+
# Assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch:
33+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
34+
# The GH actions bot is used by default if you didn't specify the two fields.
35+
# You can swap them out with your own user credentials.
36+
user_name: github-actions[bot]
37+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)