-
Notifications
You must be signed in to change notification settings - Fork 53
42 lines (35 loc) · 952 Bytes
/
main.yaml
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: Daily Make and Commit
on:
schedule:
- cron: '0 21 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1 # 只获取最近一次提交
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.cache
~/.local
key: ${{ runner.os }}-cache-${{ hashFiles('**/makefile') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Set up environment
run: |
sudo apt-get update && sudo apt-get install -y make
- name: Run make
run: make
- name: Commit and push if it changed
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m 'Automated update'
git push
fi