cloudflare / pages-action

MIT License
473 stars 97 forks source link

Additional environment variables? #10

Closed brycewray closed 1 month ago

brycewray commented 2 years ago

What would be the proper way to add more environment variables in the use of this GitHub Action? As a way of comparison, a similar Action for Vercel deployments (https://github.com/BetaHuhn/deploy-to-vercel-action) has an optional BUILD_ENV key for inserting these vars, e.g.:

      - name: Publish to Vercel
        uses: BetaHuhn/deploy-to-vercel-action@v1
        with:
          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_HUGO_SITE }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID}}
          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID}}
          WORKING_DIRECTORY: 'public'
          BUILD_ENV: |
            WEBMENTION_IO_TOKEN="${{ secrets.WEBMENTION_IO_TOKEN }}"

Is something like that possible with pages-action, too? Thanks in advance for any related info you could provide.

froblesmartin commented 11 months ago

@WalshyDev pinging you as it seems you are the maintainer here. Any comment about this? :)

nprogers commented 1 month ago

You can add an env section to your workflow file that is accessible to all steps. Here are the github docs: https://docs.github.com/en/actions/learn-github-actions/variables

I'm closing this ticket as it is pretty old, please reopen and @ me if this does not address your issue