-
Notifications
You must be signed in to change notification settings - Fork 24
51 lines (47 loc) · 1.25 KB
/
generate-mainpage.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
name: Genarate static mainpage
on:
workflow_dispatch: {}
push:
branches:
- main
- dev
paths:
- mainpage/**
- .github/workflows/generate-mainpage.yml
env:
TZ: Asia/Shanghai
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'SubConv/SubConv'
defaults:
run:
working-directory: mainpage
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.15.0
- name: Install Dependencies
run: yarn
- name: Build
run: yarn run build
- name: move to static
run: |
pwd
if [ ! -d "../static" ]; then
mkdir -p ../static
else
rm -rf ../static/*
fi
mv dist/* ../static
git config --global user.name 'GitHub Actions'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add -A
git commit -am "update static" && git push || echo "No changes to commit"