Rename cicd to cicd.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |