Closed shakibhasan09 closed 1 week ago
- name: Deploy Pages uses: cloudflare/wrangler-action@v3 with: preCommands: | cp wrangler.toml.example wrangler.toml sed -i 's|\bdatabase_id\b = ".*"|database_id = "${{ vars.DB_DATABASE_ID }}"|g' wrangler.toml sed -i 's|database_name = ".*"|database_name = "${{ vars.DB_DATABASE_NAME }}"|g' wrangler.toml pnpm pages:build command: pages deploy workingDirectory: apps/web apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
Are there any way we can use wrangler bindings instead of using sed? I'm not pushing the wrangler.toml file.
You should be able to add --var ${{ vars.DB_DATABASE_ID }} = database_id to the end of the command. https://developers.cloudflare.com/workers/wrangler/commands/#deploy
--var ${{ vars.DB_DATABASE_ID }} = database_id
Are there any way we can use wrangler bindings instead of using sed? I'm not pushing the wrangler.toml file.