Update push-cloudflare.yaml
This commit is contained in:
parent
3d2fc3d24d
commit
a634302111
1 changed files with 14 additions and 2 deletions
16
.github/workflows/push-cloudflare.yaml
vendored
16
.github/workflows/push-cloudflare.yaml
vendored
|
|
@ -15,9 +15,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# selecting a toolchain either by action or manual `rustup` calls should happen
|
# 安装 Rust
|
||||||
# before the plugin, as the cache uses the current rustc version as its cache key
|
|
||||||
- run: rustup toolchain install stable --profile minimal
|
- run: rustup toolchain install stable --profile minimal
|
||||||
|
|
||||||
|
# 缓存 Cargo
|
||||||
- name: Cache Cargo registry and build artifacts
|
- name: Cache Cargo registry and build artifacts
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -29,19 +30,30 @@ jobs:
|
||||||
key: cargo-build-cache-${{ github.run_id }}
|
key: cargo-build-cache-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cargo-build-cache-
|
cargo-build-cache-
|
||||||
|
|
||||||
|
# 添加 wasm 目标
|
||||||
- run: rustup target add wasm32-unknown-unknown
|
- run: rustup target add wasm32-unknown-unknown
|
||||||
|
|
||||||
|
# 编译器依赖
|
||||||
- name: Install lld
|
- name: Install lld
|
||||||
run: sudo apt install -y lld clang gcc llvm
|
run: sudo apt install -y lld clang gcc llvm
|
||||||
|
|
||||||
|
# 安装 worker-build(版本不变)
|
||||||
- name: Install worker-build
|
- name: Install worker-build
|
||||||
run: |
|
run: |
|
||||||
if ! command -v worker-build &> /dev/null; then
|
if ! command -v worker-build &> /dev/null; then
|
||||||
cargo install worker-build
|
cargo install worker-build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 强制安装 wasm-bindgen-cli = 0.2.103
|
||||||
|
- name: Install wasm-bindgen-cli 0.2.103
|
||||||
|
run: cargo install -f wasm-bindgen-cli --version 0.2.103
|
||||||
|
|
||||||
|
# 替换 wrangler 配置
|
||||||
- name: Replace D1_DATABASE_ID in wrangler.toml
|
- name: Replace D1_DATABASE_ID in wrangler.toml
|
||||||
run: sed -i "s/\${D1_DATABASE_ID}/${{ secrets.D1_DATABASE_ID }}/g" wrangler.toml
|
run: sed -i "s/\${D1_DATABASE_ID}/${{ secrets.D1_DATABASE_ID }}/g" wrangler.toml
|
||||||
|
|
||||||
|
# Cloudflare 部署
|
||||||
- uses: cloudflare/wrangler-action@v3
|
- uses: cloudflare/wrangler-action@v3
|
||||||
id: cf
|
id: cf
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue