-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 1.85 KB
/
deploy.yaml
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
name: My blog Deploy
on:
push:
branches:
- main
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 21
uses: actions/setup-node@v3
with:
node-version: 21
- name: Install Dependencies
run:
npm install;
npm update
# - name: Look floder
# run:
# tree -I 'node_modules,.git,scaffolds'
# - name: Copy my posts
# run:
# mkdir -p ./source/{_posts,categories,tags};
# cp ./docs/*.md ./source/_posts;
# cp ./categories/index.html ./source/categories;
# cp ./tags/index.html ./source/tags;
# # cp -f ./_config.*.yml ./;
# - name: Check _config.butterfly.yml
# run: cat _config.butterfly.yml
- name: Fix File Modify Date
run: |
git ls-files | while read filepath; do touch -d "$(git log -1 --format='@%ct' $filepath)" "$filepath" && echo "Fixed: $filepath"; done
- name: Build Site
run: |
export TZ='Asia/Shanghai'
yarn build
# - name: Tar
# run: |
# tar czvf website.tar.gz ./*
# git add
# git commit -m '1'
# git push origin main
# - name: Deploy to My Github Pages
# run:
# hexo g
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
# cname: blog-zjp.cn.eu.org
# - name: Setup Deploy Private Key
# env:
# HEXO_DEPLOY_KEY: ${{ secrets.HEXO_DEPLOY_KEY }}
# run: |
# mkdir -P ~/.ssh/
# echo '$HEXO_DEPLOY_KEY' > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa