Compare commits

..

5 Commits

Author SHA1 Message Date
ba7e31022a Merge pull request '优化CI流程' (#5) from dev into main
Reviewed-on: http://gitea.lionhao.top/jjnwxs/jingji_spbook_vue/pulls/5
2025-04-26 13:27:37 +00:00
ff74063961 更新文件变更检查逻辑
All checks were successful
Checking-doc / check-file-changes (pull_request) Successful in 10s
Checking-doc / build-and-deploy (pull_request) Successful in 2m2s
deploying-doc / build-and-deploy (pull_request) Successful in 2m2s
2025-04-26 21:25:10 +08:00
670e061545 添加文件变更检查步骤以决定是否执行构建和部署
All checks were successful
Checking-doc / check-file-changes (pull_request) Successful in 9s
Checking-doc / build-and-deploy (pull_request) Successful in 1m57s
2025-04-26 21:16:32 +08:00
ab2afef68a 更改dev action触发器
All checks were successful
Checking-doc / build-and-deploy (pull_request) Successful in 2m3s
2025-04-26 20:43:23 +08:00
ae28e4d3e3 在测试脚本中忽略主分支
All checks were successful
test-doc / build-and-deploy (push) Successful in 2m3s
test-doc / build-and-deploy (pull_request) Successful in 2m2s
2025-04-26 19:46:53 +08:00

View File

@@ -1,13 +1,43 @@
name: test-doc
run-name: Testing doc — ${{ gitea.run_id }}
name: Checking-doc
run-name: Checking doc — ${{ gitea.run_id }}
on:
workflow_dispatch:
pull_request:
types: [opened]
push:
types: [opened,synchronize]
jobs:
check-file-changes:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.filter.outputs.should_run }}
steps:
- name: 🚚 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📑 Check changed files
id: filter
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} || git diff --name-only HEAD~1 HEAD)
IMPORTANT_FILE_CHANGED=false
for file in $CHANGED_FILES; do
if [[ $file =~ \.(ts|yaml|json|js)$ ]]; then
IMPORTANT_FILE_CHANGED=true
break
fi
done
if [ "$IMPORTANT_FILE_CHANGED" = true ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
build-and-deploy:
needs: check-file-changes
if: ${{ needs.check-file-changes.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: read