-
Notifications
You must be signed in to change notification settings - Fork 157
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
Action fails on first deployment if secrets are used #162
Comments
The action fails to upload secrets during one of the testing steps since the Worker doesn't exist yet.
Wrangler should do this by default (it uploads an empty script). Is this failing somehow? |
Yeah, I was observing API errors. Perhaps that fallback behavior wasn’t implemented for |
Yeah might not be implemented on |
I think we can use vars also. Some basic variable are not needed to be secrets. - name: Deploy
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CF_ACCOUNT_ID }}
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: my-app
command: deploy --env dev
vars: DB_SECRET
env:
DB_SECRET: ${{ secrets.DB_SECRET }} Worked for me as of now |
Experiencing this issue too Edit: |
This should be resolved with the next release of Wrangler. |
FWIW we'll still need a PR to bump the default version of wrangler |
@JacobMGEvans i don't think your PR quite fixes this.
|
I just migrated to wrangler-action v3 and this started happening to me. It fails indefinitely though, doesn't pass on retry.
This feels like it would mess with my env vars and how the
@JacobMGEvans I'm on wrangler-action v3, do you see anything wrong with my config? I'm not sure what to do here. Here's my workflow file name: Deploy
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build_and_deploy:
name: Build and deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]
env:
ENVIRONMENT: production
APP_SECRET: ${{ secrets.APP_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: c-hive/gha-yarn-cache@v2
- name: Get version
id: version
run: echo "::set-output name=version::$(date +'%Y-%m-%dT%H:%M:%S')-${{ github.sha }}"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: 🔨📦 Build and deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
environment: 'production'
secrets: |
APP_SECRET
DATABASE_URL |
@vladinator1000 |
Whoops, sorry for the ping @JacobMGEvans 😅 New issue here #240 |
We currently upload secrets before deploying the script, but this understandably will fail if the script has never been deployed yet. We should think about how to prevent this, e.g. "touch" the script if we get a 404 response and retry.
The text was updated successfully, but these errors were encountered: