Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there are a better way to use wrangler.toml file with wrangler-action? #285

Open
shakibhasan09 opened this issue Aug 21, 2024 · 0 comments

Comments

@shakibhasan09
Copy link

      - 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant