Skip to content

Commit

Permalink
Merge pull request #204 from jgentes/patch-1
Browse files Browse the repository at this point in the history
Swap CF_API_TOKEN with CLOUDFLARE_API_TOKEN
  • Loading branch information
1000hz authored Oct 30, 2023
2 parents 581e17b + 57159ca commit 9554b35
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
```
## Authentication
You'll need to configure Wrangler using GitHub's Secrets feature - go to "Settings -> Secrets" and add your Cloudflare API token (for help finding this, see the [Workers documentation](https://developers.cloudflare.com/workers/quickstart/#api-token)). Your API token is encrypted by GitHub, and the action won't print it into logs, so it should be safe!
With your API token set as a secret for your repository, pass it to the action in the `with` block of your workflow. Below, I've set the secret name to `CF_API_TOKEN`:
With your API token set as a secret for your repository, pass it to the action in the `with` block of your workflow. Below, I've set the secret name to `CLOUDFLARE_API_TOKEN`:

```yaml
jobs:
Expand All @@ -47,7 +47,7 @@ jobs:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
```

## Configuration
Expand All @@ -60,7 +60,7 @@ jobs:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
wranglerVersion: "2.20.0"
```

Expand All @@ -72,7 +72,7 @@ jobs:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: "subfoldername"
```

Expand All @@ -84,7 +84,7 @@ jobs:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
secrets: |
SECRET1
SECRET2
Expand All @@ -101,7 +101,7 @@ jobs:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
preCommands: echo "*** pre command ***"
postCommands: |
echo "*** post commands ***"
Expand All @@ -117,7 +117,7 @@ jobs:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: whoami
```

Expand All @@ -142,7 +142,7 @@ jobs:
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
```

Note that there are a number of possible events, like `push`, that can be used to trigger a workflow. For more details on the events available, refer to the [GitHub Actions documentation](https://help.github.com/en/articles/workflow-syntax-for-github-actions#on).
Expand All @@ -163,8 +163,8 @@ jobs:
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=example
```

Expand All @@ -186,7 +186,7 @@ jobs:
- name: Deploy app
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
```

If you need help defining the correct cron syntax, check out [crontab.guru](https://crontab.guru/), which provides a friendly user interface for validating your cron schedule.
Expand All @@ -212,7 +212,7 @@ jobs:
- name: Deploy app
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: deploy --env ${{ github.event.inputs.environment }}
```

Expand Down Expand Up @@ -240,6 +240,6 @@ jobs:
- name: Deploy app
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
```

0 comments on commit 9554b35

Please sign in to comment.