-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.41 KB
/
nitwikit-sync.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: "NitWikit Sync"
on:
workflow_dispatch: # Allow manual triggering
schedule:
- cron: "0 0 * * *"
permissions:
contents: write
jobs:
update_submodules:
name: Update submodules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Update submodules
id: update
run: git submodule update --remote --recursive
- name: Run git status
id: status
run: echo "::set-output name=status::$(git status -s)"
- name: Add and commit files
env:
event_name: ${{ github.event_name }}
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git commit -m "Update Nitwikit from upstream by $event_name."
if: ${{ steps.status.outputs.status }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: main
# github_token: ${{ secrets.PAT_TOKEN }}
if: ${{ steps.status.outputs.status }}
- name: trigger deploy workflow
run: curl \
-X POST \
https://api.github.com/repos/8aka-Team/NitWikit-VitePress/actions/workflows/wiki-deploy.yml/dispatches \
-u ${{ secrets.PAT_TOKEN }} \
-d '{"ref":"${{github.ref_name}}"}'
if: ${{ steps.status.outputs.status }}