-
Notifications
You must be signed in to change notification settings - Fork 759
63 lines (54 loc) · 1.89 KB
/
Copy pathsmall8.yml
File metadata and controls
63 lines (54 loc) · 1.89 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
name: Sync packages
on:
push:
paths:
- '.github/workflows/small8.yml'
- 'diy/**'
schedule:
- cron: 35 8,23 * * *
watch:
types: started
repository_dispatch:
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: Ubuntu-20.04
name: Update ${{matrix.target}}
strategy:
fail-fast: false
matrix:
target: [main]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Initialization environment
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Clone packages
run: |
cd $GITHUB_WORKSPACE
chmod +x ${{matrix.target}}.sh
git clone -b ${{matrix.target}} https://github.com/kenzok8/small-package.git ${{matrix.target}}
cd ${{matrix.target}}
git rm -r --cache * >/dev/null 2>&1 &
rm -rf `find ./* -maxdepth 0 -type d ! -name "diy"` >/dev/null 2>&1
$GITHUB_WORKSPACE/${{matrix.target}}.sh
- name: Upload small-package
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
[ -e $GITHUB_WORKSPACE/LICENSE ] && cp $GITHUB_WORKSPACE/LICENSE $GITHUB_WORKSPACE/${{matrix.target}}
[ -e $GITHUB_WORKSPACE/README.md ] && cp $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/${{matrix.target}}
cd $GITHUB_WORKSPACE/${{matrix.target}}
git add .
git commit -am "update $(date +%m-%d" "%H:%M:%S)"
git push --quiet "https://${{ secrets.ACCESS_TOKEN }}@github.com/kenzok8/small-package.git" HEAD:${{matrix.target}}
- name: Delete old workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 1