-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (50 loc) · 1.74 KB
/
deploy_cloudflare_release.yaml
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
on:
push:
branches:
- release
env:
PROJECT_NAME: glot
WASM_PACK_URL: https://github.com/rustwasm/wasm-pack/releases/download/v0.12.1/wasm-pack-v0.12.1-x86_64-unknown-linux-musl.tar.gz
POLY_CLI_URL: https://github.com/glotlabs/poly-cli/releases/download/0.1.0-alpha12/poly_linux-x64.tar.gz
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install wasm-pack
run: |
mkdir -p ${HOME}/bin
wget --quiet -O wasm-pack.tar.gz $WASM_PACK_URL
tar -zxf wasm-pack.tar.gz --directory ${HOME}/bin --strip 1 --no-anchored --wildcards wasm-pack
rm wasm-pack.tar.gz
- name: Install poly-cli
run: |
mkdir -p ${HOME}/bin
wget --quiet -O poly.tar.gz $POLY_CLI_URL
tar -zxf poly.tar.gz --directory ${HOME}/bin poly
rm poly.tar.gz
- name: Build project
run: |
PATH="${PATH}:${HOME}/bin" poly build --release --hash-assets --script post_build.sh
- name: Prepare cloudflare functions for deploy
run: |
cp -rf glot_cloudflare/functions .
cp -rf glot_cloudflare/dist_backend .
cp -rf glot_cloudflare/src .
- name: Publish
uses: cloudflare/wrangler-action@v3.3.2
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy dist --branch main --project-name=${{ env.PROJECT_NAME }}