ci: update ci
This commit is contained in:
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-deploy-dev:
|
||||
if: github.ref_name == 'test'
|
||||
if: gitea.ref_name == 'test'
|
||||
runs-on: gitea_act_runner
|
||||
container:
|
||||
image: node:24-alpine
|
||||
@@ -72,19 +72,19 @@ jobs:
|
||||
env:
|
||||
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||
STATUS: ${{ job.status }}
|
||||
REPO: ${{ github.repository }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
BRANCH: ${{ github.ref_name }}
|
||||
COMMIT: ${{ github.sha }}
|
||||
ACTOR: ${{ github.actor }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||
BRANCH: ${{ gitea.ref_name }}
|
||||
COMMIT: ${{ gitea.sha }}
|
||||
ACTOR: ${{ gitea.actor }}
|
||||
run: |
|
||||
apk add --no-cache curl jq
|
||||
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅" || echo "❌" )
|
||||
MSG="$(printf "%s**%s** (Run #%s)\n>**构建结果**: %s\n>**构建详情**: [点击查看](%s)\n>**代码分支**: %s\n>**提交标识**: %s\n>**提交发起**: %s\n" "$EMOJI" "$REPO" "${{ github.run_number }}" "$STATUS" "$RUN_URL" "$BRANCH" "$COMMIT" "$ACTOR")"
|
||||
MSG="$(printf "%s**%s** (Run #%s)\n>**构建结果**: %s\n>**构建详情**: [点击查看](%s)\n>**代码分支**: %s\n>**提交标识**: %s\n>**提交发起**: %s\n" "$EMOJI" "$REPO" "${{ gitea.run_number }}" "$STATUS" "$RUN_URL" "$BRANCH" "$COMMIT" "$ACTOR")"
|
||||
curl -sS -H 'Content-Type: application/json' -d "{\"msgtype\":\"markdown\",\"markdown\":{\"content\":\"$MSG\"}}" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||
|
||||
build-and-deploy-prod:
|
||||
if: github.ref_name == 'main'
|
||||
if: gitea.ref_name == 'main'
|
||||
runs-on: gitea_act_runner
|
||||
container:
|
||||
image: node:24-alpine
|
||||
@@ -148,13 +148,13 @@ jobs:
|
||||
env:
|
||||
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||
STATUS: ${{ job.status }}
|
||||
REPO: ${{ github.repository }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
BRANCH: ${{ github.ref_name }}
|
||||
COMMIT: ${{ github.sha }}
|
||||
ACTOR: ${{ github.actor }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||
BRANCH: ${{ gitea.ref_name }}
|
||||
COMMIT: ${{ gitea.sha }}
|
||||
ACTOR: ${{ gitea.actor }}
|
||||
run: |
|
||||
apk add --no-cache curl jq
|
||||
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅" || echo "❌" )
|
||||
MSG="$(printf "%s**%s** (Run #%s)\n>**构建结果**: %s\n>**构建详情**: [点击查看](%s)\n>**代码分支**: %s\n>**提交标识**: %s\n>**提交发起**: %s\n" "$EMOJI" "$REPO" "${{ github.run_number }}" "$STATUS" "$RUN_URL" "$BRANCH" "$COMMIT" "$ACTOR")"
|
||||
MSG="$(printf "%s**%s** (Run #%s)\n>**构建结果**: %s\n>**构建详情**: [点击查看](%s)\n>**代码分支**: %s\n>**提交标识**: %s\n>**提交发起**: %s\n" "$EMOJI" "$REPO" "${{ gitea.run_number }}" "$STATUS" "$RUN_URL" "$BRANCH" "$COMMIT" "$ACTOR")"
|
||||
curl -sS -H 'Content-Type: application/json' -d "{\"msgtype\":\"markdown\",\"markdown\":{\"content\":\"$MSG\"}}" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||
|
||||
Reference in New Issue
Block a user