-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: 发布到华为云 | ||
|
||
on: | ||
push: | ||
branches: [ "master_alan" ] | ||
pull_request: | ||
branches: [ "master_alan" ] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
if: contains(github.event.head_commit.message, 'publish:all') | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [3.8, 3.7] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 设置 node 环境 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: 'npm' | ||
|
||
- name: 安装依赖 | ||
run: npm install | ||
|
||
- name: 构建项目 | ||
run: node scripts/publish.js --version=versions/${{ matrix.node-version }} | ||
|
||
- name: 登录华为云 | ||
uses: huaweicloud/[email protected] | ||
with: | ||
access_key_id: ${{ secrets.ACCESSKEY }} | ||
secret_access_key: ${{ secrets.SECRETACCESSKEY }} | ||
region: 'cn-north-4' | ||
|
||
# 按版本上传到对应的文件去 | ||
|
||
- name: 上传文件到华为云 (测试环境) | ||
if: contains(github.event.head_commit.message, 'publish:all:test') | ||
uses: ./.github/actions/obs-helper | ||
with: | ||
bucket_name: 'cce-creator-docs-test' | ||
local_file_path: ./versions/${{ matrix.node-version }}/.vitepress/dist | ||
obs_file_path: gitbook/creator/${{ matrix.node-version }}/manual/ | ||
operation_type: upload | ||
include_self_folder: false | ||
|
||
- name: 上传文件到华为云(正式环境) | ||
if: contains(github.event.head_commit.message, 'publish:all:prod') | ||
uses: ./.github/actions/obs-helper | ||
with: | ||
bucket_name: 'cce-creator-docs-pro' | ||
local_file_path: ./versions/${{ matrix.node-version }}/.vitepress/dist | ||
obs_file_path: gitbook/creator/${{ matrix.node-version }}/manual/ | ||
operation_type: upload | ||
include_self_folder: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
[english doc](./en/index.md) | ||
|
||
|
||
[中文文档](./zh/index.md) | ||
[中文文档](./zh/index.md) | ||
|
||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
[english doc](./en/index.md) | ||
|
||
|
||
[中文文档](./zh/index.md) | ||
[中文文档](./zh/index.md) | ||
|
||
1 |