-
Notifications
You must be signed in to change notification settings - Fork 24
51 lines (43 loc) · 1.4 KB
/
update-tag.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
name: update tag
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * 6
env:
TZ: Asia/Shanghai
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update
sudo -E apt-get -qq install git subversion git-core wget
sudo timedatectl set-timezone "$TZ"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: execute
run: |
cd $GITHUB_WORKSPACE
chmod +x UpdateTag.sh
git clone https://github.com/Sagit-chu/mosdns-container.git mosdns-container
cd mosdns-container
$GITHUB_WORKSPACE/UpdateTag.sh
- name: Upload
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
cd $GITHUB_WORKSPACE/mosdns-container
git add .
git commit -m "update tag $(TZ='Asia/Shanghai' date +%m-%d" "%H:%M)"
git push --quiet "https://${{ secrets.ACCESS_TOKEN }}@github.com/Sagit-chu/mosdns-container.git" HEAD:main
- name: Trigger build
if: steps.Upload.outputs.cache-hit != 'true'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
event-type: Tag Update