40 lines
No EOL
1.2 KiB
YAML
40 lines
No EOL
1.2 KiB
YAML
name: Deploy Dev
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
name: Deploy to Cloudflare (Dev)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- run: rustup toolchain install stable --profile minimal
|
|
|
|
- run: rustup target add wasm32-unknown-unknown
|
|
|
|
- name: Install lld
|
|
run: sudo apt install -y lld clang gcc llvm
|
|
|
|
- name: Install worker-build
|
|
run: |
|
|
if ! command -v worker-build &> /dev/null; then
|
|
cargo install worker-build
|
|
fi
|
|
|
|
- name: Replace D1_DATABASE_ID_DEV in wrangler.toml
|
|
run: sed -i "s/\${D1_DATABASE_ID_DEV}/${{ secrets.D1_DATABASE_ID_DEV }}/g" wrangler.toml
|
|
|
|
- uses: cloudflare/wrangler-action@v3
|
|
id: cf
|
|
env:
|
|
D1_DATABASE_ID: ${{ secrets.D1_DATABASE_ID_DEV }}
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
command: deploy --env dev |