Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
add ci/cd
  • Loading branch information
wangguanjiaatyuanze authored Mar 29, 2024
1 parent 9796241 commit 73efed3
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
push:
branches: [ main ] # 当push代码到main分支时会自动触发action

jobs:
build-and-deploy:
runs-on: ubuntu-latest # GitHub分配的运行平台,无需更改
steps:
- uses: actions/checkout@v2 # 使用action库 actions/checkout获取源码,执行你的操作
with:
persist-credentials: false
ref: main
submodules: true

# 安装依赖
- name: Install Dependencies
run: npm i

# 打包
- name: Build
run: npm run build

# 安装lusun-scripts
- name: Install lusun-scripts
run: npm i -g @yuanze/lusun-scripts

# 使用lusun-scripts部署到阿里云OSS
- name: Deploy to OSS
run: |
lusun-scripts deploy \
--bucket docs-lusun-web \
--endpoint oss-cn-beijing.aliyuncs.com
# 发送飞书通知
- name: Send Feishu Notification
run: |
lusun-scripts feishu \
'{"msg_type": "text", "content": {"text": "https://docs.lusun.com 发布完成"}}'

0 comments on commit 73efed3

Please sign in to comment.