-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.71 KB
/
deploy.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
on:
push:
branches:
- main
jobs:
build_deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
- run: npm install
- id: build
run: npm run build
- id: publish
uses: TencentCloud/cos-action@v1
with:
secret_id: ${{ secrets.TENCENT_SEC_ID }}
secret_key: ${{ secrets.TENCENT_SEC_KEY }}
cos_bucket: ${{ secrets.COS_BUCKET }}
cos_region: ${{ secrets.COS_REGION }}
local_path: dist
remote_path: md
clean: true
- id: purge
run: TENCENT_SEC_ID=${{ secrets.TENCENT_SEC_ID }} TENCENT_SEC_KEY=${{ secrets.TENCENT_SEC_KEY }} DOMAIN=${{ secrets.DOMAIN }} npm run purge
- name: Report result by mail
uses: dawidd6/[email protected]
with:
# mail server settings
server_address: smtp.163.com
server_port: 465
secure: true
# Optional (recommended): mail server username:
username: ${{secrets.MAIL_USERNAME}}
# Optional (recommended) mail server password:
password: ${{secrets.MAIL_PASSWORD}}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} <br><br> --- <br>${{ github.steps }}
# comma-separated string, send email to
to: ${{ secrets.NOTIFY_GROUP }}
# from email name
from: Github boy