all
This commit is contained in:
58
.gitea/workflows/deploy-dev.yaml
Normal file
58
.gitea/workflows/deploy-dev.yaml
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Deploy Dev
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
# 分支
|
||||
target_branch:
|
||||
description: 请输入要发布的分支名称
|
||||
required: true
|
||||
default: dev
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: node-22
|
||||
|
||||
steps:
|
||||
- uses: https://gitee.com/youtellme/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.target_branch }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup pnpm
|
||||
id: setup_pnpm
|
||||
uses: https://gitee.com/youtellme/pnpm-action-setup@v4
|
||||
|
||||
- name: Install dependencies
|
||||
id: install
|
||||
run: |
|
||||
rm -rf pnpm-lock.yaml node_modules
|
||||
pnpm install
|
||||
|
||||
- run: pnpm run build:web
|
||||
|
||||
# 压缩 dist 文件夹
|
||||
- name: zip dist folder
|
||||
run: |
|
||||
TIMESTAMP=$(date +%Y%m%d%H%M%S)
|
||||
BRANCH_NAME="${{ inputs.target_branch }}"
|
||||
SAFE_BRANCH_NAME="${BRANCH_NAME//\//_}"
|
||||
mkdir -p zip-output
|
||||
cd apps/web/dist
|
||||
zip -r -q ../../../zip-output/cslab-dcs-web_${SAFE_BRANCH_NAME}_${TIMESTAMP}.zip .
|
||||
cd -
|
||||
ls -lh zip-output/
|
||||
|
||||
# 上传 zip 文件到 RustFS
|
||||
- name: Upload zip to RustFS (S3)
|
||||
uses: jakejarvis/s3-sync-action@master
|
||||
with:
|
||||
args: --acl public-read
|
||||
env:
|
||||
AWS_S3_BUCKET: ${{ vars.RUSTFS_AWS_S3_BUCKET }}
|
||||
AWS_ACCESS_KEY_ID: ${{ vars.RUSTFS_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ vars.RUSTFS_SECRET_KEY }}
|
||||
AWS_REGION: us-east-1
|
||||
AWS_S3_ENDPOINT: ${{ vars.RUSTFS_AWS_S3_ENDPOINT }}
|
||||
SOURCE_DIR: zip-output
|
||||
Reference in New Issue
Block a user