Skip to content

NitWikit Sync

NitWikit Sync #74

Workflow file for this run

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 }}