-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (50 loc) · 1.93 KB
/
deploy-renderer.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
# ---------------------------------------------------------------------------------------------
# Copyright (c) Infiniscene, Inc. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------------------------------------
name: Publish renderer
on:
push:
branches:
- main
tags:
- v3.*
jobs:
deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build Studio Kit
run: |
npm ci
npm run build
npm run build:renderer
- name: Get Package Version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- uses: cloudflare/wrangler-action@2.0.0
name: Publish Release
if: startsWith(github.ref, 'refs/tags/v')
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: './build/hosted-renderer'
preCommands: |
npm install
postCommands: |
node directory-to-kv.js --prefix version/${{ steps.package-version.outputs.current-version }} --source ../../renderer/dist --destination renderer.json
wrangler kv:bulk put renderer.json --binding=SCENELESS_KV
- uses: cloudflare/wrangler-action@2.0.0
name: Publish latest
if: ${{github.ref == 'refs/heads/main' }}
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: './build/hosted-renderer'
preCommands: |
npm install
postCommands: |
node directory-to-kv.js --prefix version/latest-v2 --source ../../renderer/dist --destination renderer.json
wrangler kv:bulk put renderer.json --binding=SCENELESS_KV