Skip to content

Commit 90c09b9

Browse files
Update cloudflare/wrangler-action action to v3 (#54)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Léo Colombaro <[email protected]>
1 parent 5c24538 commit 90c09b9

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,25 @@ jobs:
1313
- name: Use Terraform
1414
uses: hashicorp/setup-terraform@v2
1515

16-
- name: Prepare Terraform State
17-
uses: cloudflare/wrangler-action@2.0.0
16+
- name: Retrieve Terraform State
17+
uses: cloudflare/wrangler-action@3.0.0
1818
with:
19-
command: kv:namespace list | jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV
19+
command: kv:namespace list > .kv_namespace_list.json
20+
postCommands: jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' .kv_namespace_list.json | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV
2021
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
21-
preCommands: apt-get update && apt-get -y install jq
22-
env:
23-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
22+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2423

2524
- name: Init Terraform
2625
run: terraform init
2726
working-directory: ./.terraform
2827

2928
- name: Download Terraform State
30-
uses: cloudflare/wrangler-action@2.0.0
29+
uses: cloudflare/wrangler-action@3.0.0
3130
with:
3231
command: kv:key get --namespace-id=${{ env.tfstate_kv }} terraform.tfstate > ./.terraform/terraform.tfstate
3332
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
33+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3434
postCommands: chmod 777 ./.terraform/terraform.tfstate
35-
env:
36-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3735
if: ${{ env.tfstate_kv != '' }}
3836

3937
- name: Configure
@@ -45,22 +43,20 @@ jobs:
4543
TF_VAR_sentry_dsn: ${{ secrets.SENTRY_DSN }}
4644

4745
- name: Init Terraform State
48-
uses: cloudflare/[email protected]
46+
uses: cloudflare/[email protected]
47+
if: ${{ env.tfstate_kv == '' }}
4948
with:
50-
command: kv:namespace list | jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV
49+
command: kv:namespace list > .kv_namespace_list.json
50+
postCommands: jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' .kv_namespace_list.json | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV
5151
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
52-
preCommands: apt-get update && apt-get -y install jq
53-
env:
54-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
55-
if: ${{ env.tfstate_kv == '' }}
52+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
5653

5754
- name: Store Terraform State
58-
uses: cloudflare/wrangler-action@2.0.0
55+
uses: cloudflare/wrangler-action@3.0.0
5956
with:
6057
command: kv:key put --namespace-id=${{ env.tfstate_kv }} terraform.tfstate --path=./.terraform/terraform.tfstate
6158
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
62-
env:
63-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
59+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
6460

6561
app:
6662
runs-on: ubuntu-latest
@@ -80,7 +76,7 @@ jobs:
8076
run: npm ci
8177

8278
- name: Publish to Cloudflare Workers
83-
uses: cloudflare/wrangler-action@2.0.0
79+
uses: cloudflare/wrangler-action@3.0.0
8480
with:
8581
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
8682
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
@@ -97,7 +93,7 @@ jobs:
9793
run: npm run build
9894

9995
- name: Publish to Cloudflare Pages
100-
uses: cloudflare/wrangler-action@2.0.0
96+
uses: cloudflare/wrangler-action@3.0.0
10197
with:
10298
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
10399
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

0 commit comments

Comments
 (0)