-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (45 loc) · 1.21 KB
/
pages-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
44
45
46
# https://www.ruanyifeng.com/blog/2016/07/yaml.html
# 手动触发
name: Build and Deploy
on:
push:
branches:
- master
# 定时任务在utc的9点执行,换算北京时间需要 + 8也就是凌晨五点
schedule:
- cron: "0 21 * * *"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["lts/fermium"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "master"
persist-credentials: false
fetch-depth: 0
env:
TZ: Asia/Shanghai
- name: Use Node.js 12.18.3
uses: actions/setup-node@v3
with:
node-version: '12.18.3'
- name: npm Install
run: npm install
- name: Build Nuxt Pages
run: npm run generate
- name: Deploy to Pages
env:
TZ: Asia/Shanghai
run: |
cd dist
git init
git config user.name "yanyue404"
git config user.email "[email protected]"
git add .
git commit -m 'Deploying to gh-pages from Github actions'
git push -f https://ACCESS_TOKEN:${{secrets.ACCESS_TOKEN }}@github.com/yanyue404/blog.git master:gh-pages
cd -