#Hello,

1 messages · Page 1 of 1 (latest)

tawdry obsidian
#

I would like to use github actions to deploy to dev, I normally do it from the cli like npx convex dev. I have created a deployment key in the Convex dashboard for both dev and production and added those as secrets in github.

In my github workflow I am adding the key into an env variable like this:

env:
  CONVEX_DEPLOY_KEY: "${{ secrets.CONVEX_DEPLOY_KEY_DEV }}"

Then, in the job steps I am doing this:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm install convex dotenv
      - run: export CONVEX_DEPLOY_KEY="$CONVEX_DEPLOY_KEY"
      - run: npx convex dev

I can see in the action output that the convex key shows obfuscated. When it gets to the point of running npx convex dev it fails because Convex expects a user interaction of visiting a URL to authorize instead of using the environment CONVEX_DEPLOY_KEY.

I'm surely doing something wrong. Does anyone has a hint?

compact barn
#

Try npx convex deploy

tawdry obsidian
#

but wouldn't that deploy to production?

compact barn
#

Any particular reason you want to deploy to dev in this way? Instead of a preview deployment?

tawdry obsidian
#

It works, thanks a lot Jamie

#

I was just trying without having read yet about preview deployments, will do that instead, thank you 👍

compact barn
#

no problem!

tawdry obsidian
#

I have this scenario, I don't use a frontend, I am only using Convex as a backend for some slack bot. What I would like to have is a workflow in which if I push a PR to a feature branch it would deploy to a preview deployment or dev deployment or something that let me see the logs of my Convex backend and then if I merge to main I would have it deploy to production

#

are preview deployments suitable for tha scenario?