-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 1.62 KB
/
cicd.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
name: Run Custom Script
name: cicd
on:
workflow_dispatch: # 触发流水线机制 手动触发
inputs:
projectname:
description: '项目名'
required: true
# 开发者维护 具体项目名
default: 'test'
servicename:
description: '服务名'
required: true
# 开发者维护 具体服务名
default: 'test'
type: choice
options:
- a
- b
- c
- d
- e
- f
environment:
description: '部署环境'
required: true
default: test
type: choice
options:
- test
- prod
comment:
description: '发布备注'
required: false
default: 'xxx'
env:
AWS_REGION: ap-southeast-1
ECR_REGISTRY: 024905375334.dkr.ecr.ap-southeast-1.amazonaws.com
CLUSTER_NAME: Cluster Name # EKS集群名
# 环境
ENVIRONMENT: ${{ github.event.inputs.environment }}
# 业务服务参数
PROJECT_NAME: ${{ github.event.inputs.projectname }}
SERVICE_NAME: ${{ github.event.inputs.servicename }}
jobs:
run_script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run custom script
run: |
#cd path/to/script/directory
#echo "Hello World!"
# 执行脚本文件
echo ${{ vars.APIFOXPROJECTID}} #仓库的变量
echo ${{ secrets.APITOKEN }} #仓库密钥
echo ${{ vars.TESTSKEY }} # 测试不存在的vars会发生什么
echo ${{ env.PROJECT_ID }}
echo "end"
sudo sh ./hello.sh