-
-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (44 loc) · 1.38 KB
/
deployment.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
name: GitHub CI
on:
push:
branches:
- main
jobs:
deploy:
name: Build
runs-on: ubuntu-latest
steps:
# correct build machine timezone
- run: sudo timedatectl set-timezone Asia/Shanghai
# checkout source
- name: Checkout
uses: actions/checkout@v2
# setup node.js
- name: Setup Node (via Volta)
uses: volta-cli/action@v4
# find yarn cache
- name: Get yarn cache path
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
# update cache
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# generate artifacts
- run: yarn install
- run: yarn build
# deployment
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# use github actions bot as committer
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# docs: https://developer.github.com/v3/activity/events/types/#commitcommentevent
commit_message: site updated at ${{ github.event.head_commit.timestamp }}