From 3f8fb392194e6781555e78205bd8a04253f5fac2 Mon Sep 17 00:00:00 2001 From: NianBroken Date: Wed, 17 Jul 2024 18:51:16 +0800 Subject: [PATCH] add --- .github/workflows/demo.yml | 82 ++++++++++++++++++++++++++++++++++++++ docs/README.md | 22 +++++----- 2 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/demo.yml diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml new file mode 100644 index 0000000..968f124 --- /dev/null +++ b/.github/workflows/demo.yml @@ -0,0 +1,82 @@ +name: Workflow Dispatch Example + +on: + workflow_dispatch: + inputs: + environment: + description: 'The environment to deploy to' + required: true + default: 'production' + type: string + branch: + description: 'The branch to deploy' + required: true + type: string + tag: + description: 'The tag to deploy' + required: true + type: string + force_deploy: + description: 'Force deployment' + required: false + type: boolean + notify: + description: 'Notify users' + required: false + type: boolean + slack_channel: + description: 'Slack channel to notify' + required: false + type: string + parallel_jobs: + description: 'Number of parallel jobs' + required: false + type: number + timeout: + description: 'Timeout duration in minutes' + required: false + type: integer + config_file: + description: 'Path to custom configuration file' + required: false + type: path + matrix: + description: 'Matrix configuration' + required: false + type: array + image: + description: 'Docker image to use for the job' + required: false + type: object + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Deploy to ${{ github.event.inputs.environment }} + run: | + echo "Deploying branch: ${{ github.event.inputs.branch }}" + echo "Deploying tag: ${{ github.event.inputs.tag }}" + if [ "${{ github.event.inputs.force_deploy }}" = "true" ]; then + echo "Forcing deployment" + fi + if [ "${{ github.event.inputs.notify }}" = "true" ]; then + echo "Notifying users" + fi + if [ "${{ github.event.inputs.slack_channel }}" ]; then + echo "Notifying Slack channel: ${{ github.event.inputs.slack_channel }}" + fi + echo "Number of parallel jobs: ${{ github.event.inputs.parallel_jobs }}" + echo "Timeout duration: ${{ github.event.inputs.timeout }} minutes" + if [ "${{ github.event.inputs.config_file }}" ]; then + echo "Using custom config file: ${{ github.event.inputs.config_file }}" + fi + if [ "${{ github.event.inputs.matrix }}" ]; then + echo "Matrix configuration: ${{ github.event.inputs.matrix }}" + fi + if [ "${{ github.event.inputs.image }}" ]; then + echo "Docker image to use: ${{ github.event.inputs.image }}" + fi diff --git a/docs/README.md b/docs/README.md index a060933..f874549 100644 --- a/docs/README.md +++ b/docs/README.md @@ -35,12 +35,12 @@ > Name = Name,Secret = 例子 -| Name | 例子 | 说明 | -| -------- | -------------------------- | ---------------------------------------------------- | -| URL | https://www.nianbroken.top | 教务系统地址 | -| USERNAME | 2971802058 | 教务系统用户名 | -| PASSWORD | Y3xhaCkb5PZ4 | 教务系统密码 | -| TOKEN | J65KWMBfyDh3YPLpcvm8 | [PushPlus 的 token](#获取-token "PushPlus 的 token") | +| Name | 例子 | 说明 | +| -------- | --------------------------- | ---------------------------------------------------- | +| URL | https://www.nianbroken.top/ | 教务系统地址 | +| USERNAME | 2971802058 | 教务系统用户名 | +| PASSWORD | Y3xhaCkb5PZ4 | 教务系统密码 | +| TOKEN | J65KWMBfyDh3YPLpcvm8 | [PushPlus 的 token](#获取-token "PushPlus 的 token") | @@ -68,10 +68,10 @@ ```json { - "code": 200, - "msg": "请求成功", - "data": "cd735c356aa14d16b1452aa932ac89cc", - "count": null + "code": 200, + "msg": "请求成功", + "data": "cd735c356aa14d16b1452aa932ac89cc", + "count": null } ``` @@ -128,4 +128,4 @@ 当检测到成绩更新时,你的页面应该与下图所示的页面完全一致或几乎一致 - \ No newline at end of file +