-
Notifications
You must be signed in to change notification settings - Fork 8
43 lines (35 loc) · 1.01 KB
/
deploy.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
name: Deploy blog to GitHub page
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '16.x'
- name: Install dependencies
run: |
npm install
- name: Build
run: |
rm -rvf dist
npm run docs:build
- name: Deploy
working-directory: ./dist
run: |
echo "booster.johnsonlee.io" > CNAME
git init
git config user.name "johnsonlee"
git config user.email "[email protected]"
git remote add origin https://johnsonlee:${GH_DEPLOY_TOKEN}@github.com/johnsonlee/booster.johnsonlee.io.git
git add .
git commit -m "Deployed by GitHub actions" -a
git push -u origin HEAD:gh-pages --force
env:
GH_DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}