上传文件至「.gitea/workflows」
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: git commit 控制 AiDA WEB-Node.js Develop 分支构建部署123
|
name: git commit 控制 AiDA WEB-Node.js 开发分支构建部署
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -14,13 +14,18 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [ 18.18.0 ]
|
node-version: [ 18.18.0 ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REMOTE_DEPLOY_PATH: /workspace/workspace_aida/DevelopVersion/develop-aida-web-front
|
REMOTE_DEPLOY_PATH: /workspace/workspace_aida/DevelopVersion/develop-aida-web-front
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: 0.记录开始时间
|
||||||
|
id: build_start_time
|
||||||
|
run: echo "current_time=$(TZ='Asia/Hong_Kong' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 1.检出代码
|
- name: 1.检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev_vite
|
||||||
|
|
||||||
- name: 2.设置 Node.js 环境
|
- name: 2.设置 Node.js 环境
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
@@ -54,3 +59,32 @@ jobs:
|
|||||||
# 否则工作流可能会因为权限不足而失败。
|
# 否则工作流可能会因为权限不足而失败。
|
||||||
sudo systemctl reload nginx
|
sudo systemctl reload nginx
|
||||||
echo "Nginx 重载命令已发送。"
|
echo "Nginx 重载命令已发送。"
|
||||||
|
|
||||||
|
- name: 5.发送构建结果邮件
|
||||||
|
if: always() # 无论上一步是否失败,都执行此步骤
|
||||||
|
uses: dawidd6/action-send-mail@v3
|
||||||
|
with:
|
||||||
|
|
||||||
|
from: ${{ secrets.MAIL_USERNAME }}
|
||||||
|
# --- 邮件配置 ---
|
||||||
|
server_address: smtp.gmail.com # 替换为你的SMTP服务器地址
|
||||||
|
server_port: 465 # 替换为你的SMTP端口 (通常是465或587)
|
||||||
|
username: ${{ secrets.MAIL_USERNAME }} # 存储在Secrets中的邮箱用户名
|
||||||
|
password: ${{ secrets.MAIL_PASSWORD }} # 存储在Secrets中的邮箱密码
|
||||||
|
subject: 'Gitea Actions 构建通知: ${{ job.status }} - AiDA back-java Develop'
|
||||||
|
# 收件人列表,可以根据需要更改
|
||||||
|
to: 'xupei3360@163.com,txli@aidlab.hk,cgzhou@aidlab.hk,zchengrong@yeah.net' # 替换为实际收件人邮箱
|
||||||
|
|
||||||
|
# --- 邮件正文内容 ---
|
||||||
|
body: |
|
||||||
|
项目: AiDA back-java Develop
|
||||||
|
分支: dev/3.1_release_merge
|
||||||
|
|
||||||
|
🎉 构建结果: ${{ job.status }}
|
||||||
|
|
||||||
|
📅 构建时间: ${{ steps.build_start_time.outputs.current_time }}
|
||||||
|
|
||||||
|
🔗 构建链接: ${{ gitea.server_url }}/${{ gitea.repository.owner.name }}/${{ gitea.repository.name }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
|
||||||
|
# 确保邮件内容为纯文本,或者你可以设置为 html: true 并调整 body
|
||||||
|
content_type: text/plain
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: 手动触发 AiDA WEB-Node.js Develop 分支构建部署
|
name: 手动触发 AiDA WEB-Node.js 开发分支构建部署
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -13,8 +13,14 @@ jobs:
|
|||||||
REMOTE_DEPLOY_PATH: /workspace/workspace_aida/DevelopVersion/develop-aida-web-front
|
REMOTE_DEPLOY_PATH: /workspace/workspace_aida/DevelopVersion/develop-aida-web-front
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: 0.记录开始时间
|
||||||
|
id: build_start_time
|
||||||
|
run: echo "current_time=$(TZ='Asia/Hong_Kong' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 1.检出代码
|
- name: 1.检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev_vite
|
||||||
|
|
||||||
- name: 2.设置 Node.js 环境
|
- name: 2.设置 Node.js 环境
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
@@ -48,3 +54,32 @@ jobs:
|
|||||||
# 否则工作流可能会因为权限不足而失败。
|
# 否则工作流可能会因为权限不足而失败。
|
||||||
sudo systemctl reload nginx
|
sudo systemctl reload nginx
|
||||||
echo "Nginx 重载命令已发送。"
|
echo "Nginx 重载命令已发送。"
|
||||||
|
|
||||||
|
- name: 5.发送构建结果邮件
|
||||||
|
if: always() # 无论上一步是否失败,都执行此步骤
|
||||||
|
uses: dawidd6/action-send-mail@v3
|
||||||
|
with:
|
||||||
|
|
||||||
|
from: ${{ secrets.MAIL_USERNAME }}
|
||||||
|
# --- 邮件配置 ---
|
||||||
|
server_address: smtp.gmail.com # 替换为你的SMTP服务器地址
|
||||||
|
server_port: 465 # 替换为你的SMTP端口 (通常是465或587)
|
||||||
|
username: ${{ secrets.MAIL_USERNAME }} # 存储在Secrets中的邮箱用户名
|
||||||
|
password: ${{ secrets.MAIL_PASSWORD }} # 存储在Secrets中的邮箱密码
|
||||||
|
subject: 'Gitea Actions 构建通知: ${{ job.status }} - AiDA back-java Develop'
|
||||||
|
# 收件人列表,可以根据需要更改
|
||||||
|
to: 'xupei3360@163.com,txli@aidlab.hk,cgzhou@aidlab.hk,zchengrong@yeah.net' # 替换为实际收件人邮箱
|
||||||
|
|
||||||
|
# --- 邮件正文内容 ---
|
||||||
|
body: |
|
||||||
|
项目: AiDA back-java Develop
|
||||||
|
分支: dev/3.1_release_merge
|
||||||
|
|
||||||
|
🎉 构建结果: ${{ job.status }}
|
||||||
|
|
||||||
|
📅 构建时间: ${{ steps.build_start_time.outputs.current_time }}
|
||||||
|
|
||||||
|
🔗 构建链接: ${{ gitea.server_url }}/${{ gitea.repository.owner.name }}/${{ gitea.repository.name }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
|
||||||
|
# 确保邮件内容为纯文本,或者你可以设置为 html: true 并调整 body
|
||||||
|
content_type: text/plain
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: AiDA WEB-Node.js StableVersion 分支构建部署
|
name: AiDA WEB-Node.js 生产分支构建部署
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -11,17 +11,16 @@ jobs:
|
|||||||
node-version: [ 18.18.0 ]
|
node-version: [ 18.18.0 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: 0.记录开始时间
|
||||||
|
id: build_start_time
|
||||||
|
run: echo "current_time=$(TZ='Asia/Hong_Kong' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 1.检出代码
|
- name: 1.检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: StableVersion
|
ref: StableVersion
|
||||||
|
|
||||||
- name: 2.打印当前分支信息
|
- name: 2.设置 Node.js 环境
|
||||||
run: |
|
|
||||||
echo "Current branch being deployed is: $(git rev-parse --abbrev-ref HEAD)"
|
|
||||||
echo "The code is from the 'main' branch, as specified in 'actions/checkout'."
|
|
||||||
|
|
||||||
- name: 3.设置 Node.js 环境 ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
@@ -49,5 +48,31 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET_NAME }}/ --acl public-read
|
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET_NAME }}/ --acl public-read
|
||||||
|
|
||||||
- name: 6.部署完成
|
- name: 6.发送构建结果邮件
|
||||||
run: echo "构建和部署到 S3 任务完成。"
|
if: always() # 无论上一步是否失败,都执行此步骤
|
||||||
|
uses: dawidd6/action-send-mail@v3
|
||||||
|
with:
|
||||||
|
|
||||||
|
from: ${{ secrets.MAIL_USERNAME }}
|
||||||
|
# --- 邮件配置 ---
|
||||||
|
server_address: smtp.gmail.com # 替换为你的SMTP服务器地址
|
||||||
|
server_port: 465 # 替换为你的SMTP端口 (通常是465或587)
|
||||||
|
username: ${{ secrets.MAIL_USERNAME }} # 存储在Secrets中的邮箱用户名
|
||||||
|
password: ${{ secrets.MAIL_PASSWORD }} # 存储在Secrets中的邮箱密码
|
||||||
|
subject: 'Gitea Actions 构建通知: ${{ job.status }} - AiDA back-java Develop'
|
||||||
|
# 收件人列表,可以根据需要更改
|
||||||
|
to: 'xupei3360@163.com,txli@aidlab.hk,cgzhou@aidlab.hk,zchengrong@yeah.net' # 替换为实际收件人邮箱
|
||||||
|
|
||||||
|
# --- 邮件正文内容 ---
|
||||||
|
body: |
|
||||||
|
项目: AiDA back-java Develop
|
||||||
|
分支: dev/3.1_release_merge
|
||||||
|
|
||||||
|
🎉 构建结果: ${{ job.status }}
|
||||||
|
|
||||||
|
📅 构建时间: ${{ steps.build_start_time.outputs.current_time }}
|
||||||
|
|
||||||
|
🔗 构建链接: ${{ gitea.server_url }}/${{ gitea.repository.owner.name }}/${{ gitea.repository.name }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
|
||||||
|
# 确保邮件内容为纯文本,或者你可以设置为 html: true 并调整 body
|
||||||
|
content_type: text/plain
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
name: AiDA WEB-Node.js StableVersion 分支构建部署
|
name: AiDA WEB-Node.js 生产分支构建部署
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# cron为UTC时区,构建时间=部署时间-8小时 {*分 (-8)时 *日 *月 *周} ---
|
# cron为UTC时区,构建时间=部署时间-8小时 {*分 (-8)时 *日 *月 *周} ---
|
||||||
# 示例: 1月1日22点22分触发构建 cron写作 - '22 14 1 1 *'
|
# 示例: 1月1日22点22分触发构建 cron写作 - '22 14 1 1 *'
|
||||||
- cron: '59 15 28 11 *'
|
- cron: '22 14 1 1 *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -14,17 +14,16 @@ jobs:
|
|||||||
node-version: [ 18.18.0 ]
|
node-version: [ 18.18.0 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: 0.记录开始时间
|
||||||
|
id: build_start_time
|
||||||
|
run: echo "current_time=$(TZ='Asia/Hong_Kong' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 1.检出代码
|
- name: 1.检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: StableVersion
|
ref: StableVersion
|
||||||
|
|
||||||
- name: 2.打印当前分支信息
|
- name: 2.设置 Node.js 环境
|
||||||
run: |
|
|
||||||
echo "Current branch being deployed is: $(git rev-parse --abbrev-ref HEAD)"
|
|
||||||
echo "The code is from the 'main' branch, as specified in 'actions/checkout'."
|
|
||||||
|
|
||||||
- name: 3.设置 Node.js 环境 ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
@@ -52,5 +51,31 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET_NAME }}/ --acl public-read
|
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET_NAME }}/ --acl public-read
|
||||||
|
|
||||||
- name: 6.部署完成
|
- name: 6.发送构建结果邮件
|
||||||
run: echo "构建和部署到 S3 任务完成。"
|
if: always() # 无论上一步是否失败,都执行此步骤
|
||||||
|
uses: dawidd6/action-send-mail@v3
|
||||||
|
with:
|
||||||
|
|
||||||
|
from: ${{ secrets.MAIL_USERNAME }}
|
||||||
|
# --- 邮件配置 ---
|
||||||
|
server_address: smtp.gmail.com # 替换为你的SMTP服务器地址
|
||||||
|
server_port: 465 # 替换为你的SMTP端口 (通常是465或587)
|
||||||
|
username: ${{ secrets.MAIL_USERNAME }} # 存储在Secrets中的邮箱用户名
|
||||||
|
password: ${{ secrets.MAIL_PASSWORD }} # 存储在Secrets中的邮箱密码
|
||||||
|
subject: 'Gitea Actions 构建通知: ${{ job.status }} - AiDA back-java Develop'
|
||||||
|
# 收件人列表,可以根据需要更改
|
||||||
|
to: 'xupei3360@163.com,txli@aidlab.hk,cgzhou@aidlab.hk,zchengrong@yeah.net' # 替换为实际收件人邮箱
|
||||||
|
|
||||||
|
# --- 邮件正文内容 ---
|
||||||
|
body: |
|
||||||
|
项目: AiDA back-java Develop
|
||||||
|
分支: dev/3.1_release_merge
|
||||||
|
|
||||||
|
🎉 构建结果: ${{ job.status }}
|
||||||
|
|
||||||
|
📅 构建时间: ${{ steps.build_start_time.outputs.current_time }}
|
||||||
|
|
||||||
|
🔗 构建链接: ${{ gitea.server_url }}/${{ gitea.repository.owner.name }}/${{ gitea.repository.name }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
|
||||||
|
# 确保邮件内容为纯文本,或者你可以设置为 html: true 并调整 body
|
||||||
|
content_type: text/plain
|
||||||
Reference in New Issue
Block a user