-
Notifications
You must be signed in to change notification settings - Fork 21
117 lines (99 loc) · 3.97 KB
/
web-bsn.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Build BSN Web
on:
workflow_dispatch:
env:
owner: ObsidianLabs
own_components: algorand-components
share_components: electron-components
project_build: algorand
project_name: Algorand Studio
project_build_script: yarn && PUBLIC_URL=/ CDN=true yarn build:react
enable_auth: true
cos_bucket: bsn-algo-1303090311
cos_region: ap-singapore
dns_path: https://algoide.bsnbase.io/
jobs:
# Build and release
release:
runs-on: ubuntu-18.04
steps:
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Checkout ${{ env.share_components }}
uses: actions/checkout@v2
with:
repository: ${{ env.owner }}/${{ env.share_components }}
ref: master
path: ./${{ env.share_components }}
token: ${{ secrets.obsidians_token }}
- name: Checkout ${{ env.own_components }}
uses: actions/checkout@v2
with:
repository: ${{ env.owner }}/${{ env.own_components }}
ref: master
path: ./${{ env.own_components }}
token: ${{ secrets.obsidians_token }}
- name: Checkout ${{ env.project_name }}
uses: actions/checkout@v2
with:
ref: master
path: ./studio
- name: Replace .env
working-directory: ./studio
run: cp ./envs/.env.bsn .env
- name: Install ${{ env.share_components }} submodule
working-directory: ./${{ env.share_components }}
run: git submodule update --init
- name: Install ${{ env.share_components }} dependencies
working-directory: ./${{ env.share_components }}
run: yarn
- name: Build ${{ env.share_components }}
working-directory: ./${{ env.share_components }}
run: yarn build
- name: Install ${{ env.own_components }} submodule
working-directory: ./${{ env.own_components }}
run: git submodule update --init
- name: Install ${{ env.own_components }} dependencies
working-directory: ./${{ env.own_components }}
run: yarn
- name: Build ${{ env.own_components }}
working-directory: ./${{ env.own_components }}
run: yarn build
- name: Build ${{ env.project_name }}
uses: ObsidianLabs/studio-build-action@master
with:
build: ${{ env.project_build }}
project: ${{ env.project_project }}
project_name: ${{ env.project_name }}
build_script: ${{ env.project_build_script }}
working-directory: ./studio
enable_auth: ${{ env.enable_auth }}
fontawesome_token: ${{ secrets.fontawesome_token }}
mac_certs: ${{ secrets.certs }}
mac_certs_password: ${{ secrets.certs_password }}
windows_certs: ${{ secrets.certs }}
windows_certs_password: ${{ secrets.certs_password }}
github_token: ${{ github.token }}
- name: Create a placeholder for COS
run: echo cos > ./.placeholder
- name: Upload ${{ env.project_name }} to COS
uses: zkqiang/[email protected]
with:
args: upload ./.placeholder / && delete -r -f / && upload -r ./studio/build/ /
secret_id: ${{ secrets.tencent_cloud_secretid }}
secret_key: ${{ secrets.tencent_cloud_secretkey }}
bucket: ${{ env.cos_bucket }}
region: ${{ env.cos_region }}
- name: Flush ${{ env.project_name }} CDN
uses: TencentCloud/cli-action@v1
with:
secret_id: ${{ secrets.tencent_cloud_secretId }}
secret_key: ${{ secrets.tencent_cloud_secretKey }}
# Tencent Cloud product region
region: ${{ env.cos_region }}
# Tencent Cloud CLI commands. Mult commands seperate by `&&`
commands: "cdn PurgePathCache --cli-unfold-argument --Paths ${{ env.dns_path }} --FlushType flush"
# Data format of command output. Available values are `json`, `table`, `text`. Default is `json`
output_format: "json"