-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.19 KB
/
update.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
name: 'GitHub Actions Check for Minecraft Data update.'
on:
schedule:
# 定时任务,在每天的5点检查更新
- cron: '0 18 * * *'
workflow_dispatch: {}
jobs:
bot:
runs-on: ubuntu-latest
steps:
# 首先copy git仓库到虚拟机上
- name: 'Checkout codes'
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2 #安装node.js
with:
node-version: '18'
- name: Running bash
run: |
git config --global user.name "wifi_left"
git config --global user.email "ysy1679682327@outlook.com"
bash ./run.sh
- name: Make changes
run: |
node run_git_command_date.js
git commit -a -m "Add changes"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: gitlab.com
- name: Push files
run: |
node run_git_commands.js
# 执行仓库中的脚本文件