ci: 工作流

This commit is contained in:
Rock Chin
2023-04-06 15:18:02 +08:00
parent 21ff0fd258
commit 0dfd636a7e
+17 -12
View File
@@ -1,26 +1,31 @@
name: Sync Wiki on Update name: Update Wiki
on: on:
push: push:
paths: paths:
- 'res/wiki/**' - 'res/wiki/**'
jobs: jobs:
build: update-wiki:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout QChatGPT.wiki - name: Checkout
uses: actions/checkout@v2
- name: Setup Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Clone Wiki Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
repository: RockChinQ/QChatGPT.wiki repository: RockChinQ/QChatGPT.wiki
ref: main
path: wiki path: wiki
- name: Copy updated files - name: Copy res/wiki content to wiki
run: cp -R res/wiki/* wiki/
- name: Commit and push changes
run: | run: |
cd wiki/ cp -r res/wiki/* wiki/
git config --global user.name "GitHub Action" - name: Commit and Push Changes
git config --global user.email "action@github.com" run: |
git add -A cd wiki
git commit -m "Sync Wiki on update" git add .
git commit -m "Update wiki"
git push git push