-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (97 loc) · 3.23 KB
/
daily-update.yaml
File metadata and controls
108 lines (97 loc) · 3.23 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build Website and Push
on:
push:
branches:
- main
schedule:
- cron: '55 15 * * *'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Set Up timezone
uses: szenius/set-timezone@v2.0
with:
timezoneLinux: "Asia/Shanghai"
- name: Checkout course
uses: actions/checkout@v2
with:
repository: 'XS-MLVP/course'
token: ${{ secrets.COMMIT_KEY }}
path: 'course'
- name: Checkout doc-xs-ov-00-bpu
uses: actions/checkout@v2
with:
repository: 'XS-MLVP/doc-xs-ov-00-bpu'
token: ${{ secrets.COMMIT_KEY }}
path: 'doc-xs-ov-00-bpu'
- name: Checkout UnityChipForXiangShan
uses: actions/checkout@v2
with:
repository: 'XS-MLVP/UnityChipForXiangShan'
token: ${{ secrets.COMMIT_KEY }}
path: 'UnityChipForXiangShan'
- name: Checkout mlvp-portal
uses: actions/checkout@v2
with:
path: 'mlvp-portal'
- name: Checkout xs-mlvp.github.io
uses: actions/checkout@v2
with:
repository: 'XS-MLVP/xs-mlvp.github.io'
token: ${{ secrets.COMMIT_KEY }}
path: 'xs-mlvp.github.io'
- name: Check if there are commits today
id: check-commits
run: |
skip=true
for repo in course doc-xs-ov-00-bpu mlvp-portal; do
cd $repo
if [ "$(git log --since='1 day ago' --oneline | wc -l)" -ne "0" ]; then
skip=false
cd ..
break
fi
cd ..
done
cd UnityChipForXiangShan
DIRECTORY="documents"
if [ "$(git log -1 --format=%ct -- $DIRECTORY)" -ne "0" ]; then
echo "New commits found in $DIRECTORY"
skip=false
else
echo "No new commits in $DIRECTORY"
fi
cd ..
cd xs-mlvp.github.io
DIRECTORY="UnityChipForXiangShan/data/reports"
if [ "$(git log -1 --format=%ct -- $DIRECTORY)" -ne "0" ]; then
echo "New commits found in $DIRECTORY"
skip=false
fi
cd ..
echo "SKIP=$skip" >> $GITHUB_ENV
shell: bash
- name: Run make commands
if: env.SKIP == 'false'
run: |
cd /home/runner/work/mlvp-portal/mlvp-portal/course
make init
cd /home/runner/work/mlvp-portal/mlvp-portal/doc-xs-ov-00-bpu
make init
cd /home/runner/work/mlvp-portal/mlvp-portal/UnityChipForXiangShan/documents
ln -s /home/runner/work/mlvp-portal/mlvp-portal/xs-mlvp.github.io/UnityChipForXiangShan/data/reports static/data/reports
find /home/runner/work/mlvp-portal/mlvp-portal/xs-mlvp.github.io/UnityChipForXiangShan/data/reports -maxdepth 1 -mindepth 1 -type d -print0 | sort -zr | tail -zn +2 | xargs -0 rm -rf
make init
cd /home/runner/work/mlvp-portal/mlvp-portal/mlvp-portal
npm install -D autoprefixer
npm install -D postcss-cli
npm install -D postcss
make build
- name: Configure git and sync
if: env.SKIP == 'false'
run: |
cd /home/runner/work/mlvp-portal/mlvp-portal/xs-mlvp.github.io
git config user.name "github-actions[bot]"
git config user.email "22570332+github-actions[bot]@users.noreply.github.com"
make sync