-
-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathcloudflare-deploy.sh
More file actions
executable file
·26 lines (20 loc) · 920 Bytes
/
Copy pathcloudflare-deploy.sh
File metadata and controls
executable file
·26 lines (20 loc) · 920 Bytes
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
#!/usr/bin/env bash
# This script is run by Cloudflare's worker to build the deployment
set -euxo pipefail
# Base URL used to fetch assets
if [ "$CF_PAGES_BRANCH" == "main" ]; then
export BASE_URL="https://www.raphael-xiv.com"
else
export BASE_URL=$CF_PAGES_URL
fi
# Install the Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
. "$HOME/.cargo/env"
cp --no-target-directory ./.cargo/config.toml ./.cargo/config.toml.backup
cp --no-target-directory ./.cargo/config_wasm.toml ./.cargo/config.toml
trap "mv --no-target-directory ./.cargo/config.toml.backup ./.cargo/config.toml" EXIT
# install cargo-binstall
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# install trunk
cargo-binstall --no-confirm --locked trunk
trunk build index.html --release