From 5dc7514f0592b9d71b8f06b6a9bd6a1645d861a0 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 28 Nov 2025 11:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=E3=80=8C.gitea/workflows=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/prod_build_manual.yaml | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .gitea/workflows/prod_build_manual.yaml diff --git a/.gitea/workflows/prod_build_manual.yaml b/.gitea/workflows/prod_build_manual.yaml new file mode 100644 index 00000000..469b035f --- /dev/null +++ b/.gitea/workflows/prod_build_manual.yaml @@ -0,0 +1,53 @@ +name: 手动 AiDA WEB-Node.js 生产分支构建部署 +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 18.18.0 ] + + steps: + - name: 1.检出代码 + uses: actions/checkout@v4 + with: + ref: StableVersion + + - name: 2.打印当前分支信息 + 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 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run build + - run: ls -l + + - name: 3.5. 手动安装 AWS CLI v2 + run: | + echo "安装 AWS CLI V2..." + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install --update + aws --version + echo "AWS CLI V2 安装完成。" + + - name: 4.配置 AWS 凭证 + uses: aws-actions/configure-aws-credentials@main + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: 'ap-east-1' + + - name: 5.同步 dist 目录到 S3 + run: | + aws s3 sync dist/* s3://${{ secrets.S3_BUCKET_NAME }}/ --acl public-read + + - name: 6.部署完成 + run: echo "构建和部署到 S3 任务完成。" \ No newline at end of file