-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (52 loc) · 1.5 KB
/
check-banner.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
61
62
63
64
name: "Check Banner"
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
jobs:
script:
name: Script
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout data
uses: actions/checkout@v4
with:
ref: data
path: data
filter: blob:none
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Cache node modules
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Create local changes
timeout-minutes: 15
run: npm run check-banner
env:
GAME_ACCOUNT: ${{ secrets.GAME_ACCOUNT }}
GAME_SECRET: ${{ secrets.GAME_SECRET }}
DC_WEBHOOK: ${{ secrets.DC_WEBHOOK }}
NODE_ENV: production
- run: |
cd data
git pull --rebase --autostash
- name: Commit files
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 更新Banner資料
repository: data