15
15
with :
16
16
submodules : recursive # to fetch Hugo themes
17
17
18
+ - name : Update submodules
19
+ run : git submodule update --remote --recursive
20
+
18
21
- uses : dorny/paths-filter@v3
19
22
id : changes
20
23
with :
23
26
- 'static/**'
24
27
- '**/*.md'
25
28
- 'layouts/**'
29
+ - '!public/**'
26
30
27
31
- name : Setup Hugo
28
32
uses : peaceiris/actions-hugo@v3
@@ -36,18 +40,33 @@ jobs:
36
40
-
uses :
webfactory/[email protected]
37
41
with :
38
42
ssh-private-key : ${{ secrets.SSH_PRIVATE_DEPLOY_KEY }}
39
- if : github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
40
43
41
- - name : Prepare Git setting, commit & push
44
+ - name : Prepare Git setting
42
45
run : |
43
46
# `actions/checkout`が設定した`url.https://github.com/.insteadOf`を消しておく。
44
47
# https://github.com/actions/checkout/blob/9a9194f87191a7e9055e3e9b95b8cfb13023bb08/adrs/0153-checkout-v2.md?plain=1#L261
45
48
git submodule foreach --recursive git config --local --unset-all 'url.https://github.com/.insteadOf'
49
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
50
+ git config --global user.name "github-actions[bot]"
51
+
52
+ - name : Commit & push
53
+ run : |
46
54
cd public
47
- git config --local user.email "[email protected] "
48
- git config --local user.name "YOSHIMURA Yuu"
49
55
git remote set-url origin [email protected] :urandom-ctf/urandom-ctf.github.io.git
50
56
git add --all
51
- git commit -m 'Update website'
57
+ git commit -m 'Update website by ${{ github.sha }} '
52
58
git push origin master
53
59
if : github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
60
+
61
+ - name : Update submodule
62
+ run : |
63
+ git add public
64
+ git commit -m "[skip ci] Update submodules by ${{ github.sha }}"
65
+ if : github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
66
+
67
+ - name : Push changes
68
+ uses : ad-m/github-push-action@master
69
+ with :
70
+ github_token : ${{ secrets.GITHUB_TOKEN }}
71
+ branch : master
72
+ if : github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
0 commit comments