-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (46 loc) · 1.82 KB
/
deploy-oss.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 20
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 安装依赖
if: contains(github.event.head_commit.message, 'docs')
run: npm install
- name: 构建项目
if: contains(github.event.head_commit.message, 'docs')
run: |
npm run docs:build
echo 构建成功.
- name: 启用 oss-util 工具
uses: manyuanrong/[email protected]
with:
endpoint: 'oss-cn-hangzhou.aliyuncs.com'
access-key-id: ${{ secrets.OSS_ID }}
access-key-secret: ${{ secrets.OSS_SECRET }}
- name: 项目部署 - docs
if: contains(github.event.head_commit.message, 'docs')
run: |
ossutil cp -rf ./projects/document/docs/.vitepress/dist oss://website-cocos-fe/
- name: 项目部署 - githubIds
if: contains(github.event.head_commit.message, 'github')
run: |
ossutil cp -rf ./projects/github-ids/github-ids.json oss://90s/github-ids/