ENV variables with wrangler pages CLI (VITE REACT)

How do I add env variables to a deployment of a pages application? I am writing a github action that is suppossed to deploy my pages application, and I am trying to grap some secrets from the repo, and add them as env variables for the pages.
I have tried this:
- name: Deploy to Cloudflare Pages
        working-directory: ./apps/frontend
        env:
          CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
          CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
          MY_VARIABLE: ${{ secrets.MY_VALUE}}
        run: |
          wrangler pages deploy ./dist --project-name=frontend-preview --branch=main --commit-dirty=true

But MY_VARIABLE does not show up in the pages dashboard. How can this be done?
Was this page helpful?