-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (74 loc) · 2.66 KB
/
code-quality.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# 代码质量检测 https://github.com/marketplace/actions/qodana-scan
name: Qodana Code Quality
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- 'releases/*'
jobs:
qodana:
runs-on: ubuntu-latest
#if: ${{ contains(github.event.head_commit.message, 'taotao-cloud-qodana') }}
steps:
#https://github.com/marketplace/actions/checkout
- name: Checkout Project
uses: actions/[email protected]
with:
fetch-depth: 0
#https://github.com/marketplace/actions/qodana-scan
- name: Qodana Scan
uses: JetBrains/[email protected]
with:
#args: "--project-dir ${{ github.workflow }}/taotao-cloud-microservice"
results-dir: ${{ github.workspace }}/qodana/results
- name: Upload Sarif
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ github.workspace }}/qodana/results/qodana.sarif.json
#https://github.com/marketplace/actions/github-pages-action
- name: Deploy To GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.TAOTAO_CLOUD_GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/qodana/results/report
destination_dir: ./
#https://github.com/marketplace/actions/ssh-deploy
- name: Deploy To Server
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "qodana/results/report/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_QODANA_TARGET }}
- name: build success
if: ${{ success() }}
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TOKEN }}
secret: ${{ secrets.DING_SECRET }}
# body 内容 https://blog.csdn.net/lxw1844912514/article/details/125747327
body: |
{
"msgtype": "text",
"text": {
"content": "taotao github action [taotao-cloud-code-quality] success"
}
}
- name: build failure
if: ${{ failure() }}
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TOKEN }}
secret: ${{ secrets.DING_SECRET }}
# body 内容 https://blog.csdn.net/lxw1844912514/article/details/125747327
body: |
{
"msgtype": "text",
"text": {
"content": "taotao github action [taotao-cloud-code-quality] failure"
}
}