mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: sync-resource
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- 'resource/**'
|
|
- '.github/workflows/sync-resource.yml'
|
|
|
|
jobs:
|
|
sync-reource:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout MaaAssistantArknights
|
|
uses: actions/checkout@v4.1.1
|
|
- name: Setup Git
|
|
run: |
|
|
git config --global user.name "$GITHUB_ACTOR"
|
|
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
git show -s
|
|
- name: Checkout MaaResource
|
|
uses: actions/checkout@v4.1.1
|
|
with:
|
|
repository: MaaAssistantArknights/MaaResource
|
|
ssh-key: ${{secrets.MAA_RESOURCE_DEPLOY}}
|
|
path: MaaResource
|
|
- name: Update MaaResource
|
|
run: |
|
|
export commit_msg=$(git show -s --format=%s)
|
|
cd MaaResource
|
|
shopt -s extglob
|
|
|
|
cd resource
|
|
rm -rf !(".gitignore")
|
|
cp -rf ../../resource/* .
|
|
cd ..
|
|
|
|
git add .
|
|
git status
|
|
git commit -m "$commit_msg" || exit 0
|
|
git push
|