1+ # GitHub workflow for Cloudflare Pages build notifications
2+
3+ name : Cloudflare Pages Deploy Notify
4+
5+ # Controls when the action will run.
6+ on :
7+ # Triggers on push to main branch
8+ push :
9+ branches : [ gh-pages ]
10+ # Allows you to run this workflow manually from the Actions tab
11+ workflow_dispatch :
12+
13+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+ jobs :
15+ # This workflow contains a single job called "notify"
16+ notify :
17+ # The type of runner that the job will run on
18+ runs-on : ubuntu-latest
19+
20+ # Steps represent a sequence of tasks that will be executed as part of the job
21+ steps :
22+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+ - uses : actions/checkout@v2
24+
25+ # Get commit information
26+ - name : Get commit details
27+ id : commit
28+ run : |
29+ echo "::set-output name=message::$(git log -1 --pretty=%B)"
30+ echo "::set-output name=author::$(git log -1 --pretty=%an)"
31+
32+ # Wait for Cloudflare Pages deployment and send notification
33+ - name : Wait for Cloudflare Pages deployment
34+ uses : arddluma/cloudflare-pages-slack-notification@v4
35+ with :
36+ apiToken : ${{ secrets.CF_API_TOKEN }}
37+ accountId : ${{ secrets.CF_ACCOUNT_ID }}
38+ project : ${{ secrets.CF_PAGES_PROJECT }}
39+ slackWebHook : ${{ secrets.FEISHU_WEBHOOK }}
40+ # Comprehensive notification message
41+ message : |
42+ 🚀 Cloudflare Pages 部署通知
43+ - 项目: ${{ secrets.CF_PAGES_PROJECT }}
44+ - 环境: production
45+ - 提交信息: ${{ steps.commit.outputs.message }}
46+ - 提交作者: ${{ steps.commit.outputs.author }}
47+ - 提交: ${{ github.sha }}
48+ - 分支: ${{ github.ref }}
49+ - 仓库: ${{ github.repository }}
50+ - 触发事件: ${{ github.event_name }}
0 commit comments