-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
5c24538
commit 90c09b9
Showing
1 changed file
with
16 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,27 +13,25 @@ jobs: | |
- name: Use Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
|
||
- name: Prepare Terraform State | ||
uses: cloudflare/wrangler-action@2.0.0 | ||
- name: Retrieve Terraform State | ||
uses: cloudflare/wrangler-action@3.0.0 | ||
with: | ||
command: kv:namespace list | jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV | ||
command: kv:namespace list > .kv_namespace_list.json | ||
postCommands: jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' .kv_namespace_list.json | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
preCommands: apt-get update && apt-get -y install jq | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
|
||
- name: Init Terraform | ||
run: terraform init | ||
working-directory: ./.terraform | ||
|
||
- name: Download Terraform State | ||
uses: cloudflare/wrangler-action@2.0.0 | ||
uses: cloudflare/wrangler-action@3.0.0 | ||
with: | ||
command: kv:key get --namespace-id=${{ env.tfstate_kv }} terraform.tfstate > ./.terraform/terraform.tfstate | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
postCommands: chmod 777 ./.terraform/terraform.tfstate | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
if: ${{ env.tfstate_kv != '' }} | ||
|
||
- name: Configure | ||
|
@@ -45,22 +43,20 @@ jobs: | |
TF_VAR_sentry_dsn: ${{ secrets.SENTRY_DSN }} | ||
|
||
- name: Init Terraform State | ||
uses: cloudflare/[email protected] | ||
uses: cloudflare/[email protected] | ||
if: ${{ env.tfstate_kv == '' }} | ||
with: | ||
command: kv:namespace list | jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV | ||
command: kv:namespace list > .kv_namespace_list.json | ||
postCommands: jq -r '.[] | select( .title == "dispoflare-terraform-state" ) | .id' .kv_namespace_list.json | awk '{print "tfstate_kv="$1}' >> $GITHUB_ENV | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
preCommands: apt-get update && apt-get -y install jq | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
if: ${{ env.tfstate_kv == '' }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
|
||
- name: Store Terraform State | ||
uses: cloudflare/wrangler-action@2.0.0 | ||
uses: cloudflare/wrangler-action@3.0.0 | ||
with: | ||
command: kv:key put --namespace-id=${{ env.tfstate_kv }} terraform.tfstate --path=./.terraform/terraform.tfstate | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
|
||
app: | ||
runs-on: ubuntu-latest | ||
|
@@ -80,7 +76,7 @@ jobs: | |
run: npm ci | ||
|
||
- name: Publish to Cloudflare Workers | ||
uses: cloudflare/wrangler-action@2.0.0 | ||
uses: cloudflare/wrangler-action@3.0.0 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
|
@@ -97,7 +93,7 @@ jobs: | |
run: npm run build | ||
|
||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/wrangler-action@2.0.0 | ||
uses: cloudflare/wrangler-action@3.0.0 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
|