-
Notifications
You must be signed in to change notification settings - Fork 14
60 lines (52 loc) · 1.52 KB
/
sub-store-frontend.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 构建 Sub-Store 前端
on:
workflow_dispatch:
push:
branches:
- 'main'
paths-ignore:
- 'backend'
- 'README.md'
schedule:
- cron: "0 1 */3 * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false
- name: Install and Build
run: |
cd ..
git clone -b mod https://github.com/SaintWe/Sub-Store-Front-End.git
cd Sub-Store-Front-End
pnpm install
pnpm run build
rm -rf "$GITHUB_WORKSPACE/dist"
cp -r ./dist "$GITHUB_WORKSPACE/"
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v12
id: verify-changed-files
with:
files: |
dist
- name: Update dist folder to repository
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GIT_ACTIONS_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add .
git commit -m "GitHub Actions Auto Builder at $(date +'%Y-%m-%d %H:%M:%S')"
git push --quiet "https://[email protected]/$GITHUB_REPOSITORY.git" main:main