-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (38 loc) · 1.01 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
43
44
name: Update
on:
repository_dispatch:
workflow_dispatch:
push:
paths:
- '.github/workflows/update.yml'
branches:
- main
schedule:
- cron: 0 16 * * *
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Submodule
run: sh update.sh
- name: Check for changes
id: check_changes
run: |
if git diff --quiet; then
echo "No changes detected"
echo "::set-output name=push_required::false"
else
echo "Changes detected"
echo "::set-output name=push_required::true"
fi
- name: Deploy
if: steps.check_changes.outputs.push_required == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@github.com"
git add --all
git commit -m "$(date +'%Y-%m-%dT%H:%M:%S')"
git push