-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.79 KB
/
Copy pathbuild and deplo.yml
File metadata and controls
64 lines (56 loc) · 1.79 KB
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
name: Build And Deploy
on:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 */168 * * *" # run every 168 hours
env:
TZ: Asia/Shanghai
jobs:
build-project:
name: Build And Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build project
env:
NODE_OPTIONS: --max_old_space_size=8192
run: pnpm run build
- name: Check if there are any changes
id: verify_diff
run: git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Deploy to vodtv.github.io
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PUBLISH_DOCS }}
external_repository: vodtv/vodtv.github.io
publish_dir: .vitepress/dist
publish_branch: gh-pages
cname: vodtv.github.io
- name: Commit project 🐱🏍
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --local user.email "28900094+github-actions[bot]@users.noreply.github.com"
git config --local user.name "HeFung"
git add .
git commit -m "bing wallpaper project Update: `TZ='Asia/Shanghai' date +'%Y-%m-%d %H:%M:%S'`"
- name: Push project 🚀
if: steps.verify_diff.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main