Skip to content

Commit

Permalink
workflow触发机制优化: 增加部署触发条件
Browse files Browse the repository at this point in the history
  • Loading branch information
Null committed Aug 15, 2024
1 parent 87f7802 commit b7a468f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [master]

repository_dispatch:
types: [deploy_site]

# 权限设置
permissions:
# 允许读取仓库内容的权限。
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ jobs:
git add CHANGELOG.md
git commit -m "Update Changelog"
git push origin HEAD:${{ github.ref }}
- name: Trigger Deploy Workflow
run: |
curl -X POST -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type":"deploy_site"}'

0 comments on commit b7a468f

Please sign in to comment.