This repository has been archived by the owner on Apr 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
60 lines (55 loc) · 1.64 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
54
55
56
57
58
59
60
name: "deploy"
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "**.py"
- "**.json"
- "**.sh"
- ".github/workflows/deploy.yml"
- "!scheduler.py"
- "!ql_update.py"
concurrency:
group: deploy-workflow
cancel-in-progress: true
jobs:
deploy-to-scf:
name: Deploy to Tencent Cloud Serverless Cloud Function
runs-on: ubuntu-latest
steps:
- name: Check tencent secret
run: |
if [ -z "${{ secrets.SECRET_ID }}" ] || [ -z "${{ secrets.SECRET_KEY }}" ]; then
echo "请配置 SECRET_ID 和 SECRET_KEY 两个 secrets"
echo -e "\033[1;31m部署失败 \033[0m"
exit 1
fi
- name: Clone local repository
uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install python dependencies
run: pip install tencentcloud-sdk-python json5
- name: Deploy
run: |
bash ./serverless/deploy.sh
if [ $? -ne 0 ]; then
exit 1;
fi
env:
STAGE: dev
SERVERLESS_PLATFORM_VENDOR: tencent
TENCENT_SECRET_ID: ${{ secrets.SECRET_ID }}
TENCENT_SECRET_KEY: ${{ secrets.SECRET_KEY }}
CRON: ${{ secrets.CRON }}
REGION: ${{ secrets.REGION }}
FUNCTION_NAME: ${{ secrets.FUNCTION_NAME }}
DEFAULT_SONG_NUMER_CRON: "10 0 0 * * * *"
DEFAULT_CRON: "0 35 8 * * * *"
DEFAULT_REGION: "ap-guangzhou"
DEFAULT_FUNCTION_NAME: "NeteaseCloudMusicTasks"
SHA: ${{ github.sha }}