-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.4 KB
/
outdated.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: 过时配置文件
on:
# 手动触发
workflow_dispatch:
# push:
# branches: [main]
# pull_request:
# branches: [main]
env:
BUCKET_NAME: ${{ secrets.LAF_BUCKET_NAME }}
LAF_APPID: ${{ secrets.LAF_APPID }}
LAF_PAT: ${{ secrets.LAF_RUN_PAT }}
API_URL: "https://api.laf.run"
WEB_PATH: .
DIST_PATH: "dist/public"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.15.1
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.5.1
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run generate
env:
NUXT_PUBLIC_STUDIO_TOKENS: ${{ secrets.NUXT_PUBLIC_STUDIO_TOKENS }}
# 安装 laf-cli
- name: Install Laf-CLI
run: pnpm i laf-cli -g
# 登录 laf api
- name: Login laf-cli
run: |
laf user add ${{ env.LAF_APPID }} -r ${{ env.API_URL }}
laf user switch ${{ env.LAF_APPID }}
laf login $LAF_PAT
laf app init ${{ env.LAF_APPID }}
laf storage push -f ${{ env.BUCKET_NAME }} ${{ env.DIST_PATH }}/
# - 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: "/"