-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.02 KB
/
main.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
57
58
59
60
61
62
63
# 使用 node v18 启用 corepack pnpm,pnpm run build
name: Node.js CI
on:
# 手动触发
workflow_dispatch:
# push:
# branches: [main]
# pull_request:
# branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.8.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
# registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run generate
env:
NUXT_PUBLIC_STUDIO_TOKENS: ${{ secrets.NUXT_PUBLIC_STUDIO_TOKENS }}
# - name: Test
# run: pnpm test
- name: Upload to Tencent COS 腾讯云对象存储
uses: TencentCloud/cos-action@master
with:
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
cos_bucket: ${{ secrets.COS_BUCKET }}
cos_region: ${{ secrets.COS_REGION }}
accelerate: true # 可选,如果你懂。前提需要你手动开启全球加速
local_path: dist/public
remote_path: /
clean: true
# - name: Upload to Aliyun OSS 阿里云对象存储 不知道为啥有个 404 先不启用
# uses: jakejarvis/s3-sync-action@master
# with:
# args: --acl public-read --follow-symlinks --delete
# env:
# AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: "oss-cn-beijing" # optional: defaults to us-east-1
# AWS_S3_ENDPOINT: "https://${{ secrets.AWS_S3_BUCKET }}.oss-cn-beijing.aliyuncs.com"
# SOURCE_DIR: "dist"
# DEST_DIR: "/"