From d255dec7c925be88a11346bae3e395bacf8744c5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:30:40 +0000 Subject: [PATCH 01/14] ci: Migrate from cloudflare/pages-action to cloudflare/wrangler-action The Cloudflare Pages GitHub Action has been deprecated. This PR migrates to the recommended wrangler-action following the migration guide. Changes: - Replace cloudflare/pages-action@1 with cloudflare/wrangler-action@v3 - Update deployment configuration to use wrangler pages deploy command - Maintain existing authentication and project settings Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9dcebd74e..89c255dda 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -461,13 +461,12 @@ jobs: name: stlite-sharing path: website - name: Publish - uses: cloudflare/pages-action@1 + uses: cloudflare/wrangler-action@v3 id: publish with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: stlite-sharing - directory: website + command: pages deploy website --project-name=stlite-sharing gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-sharing-editor: @@ -525,12 +524,11 @@ jobs: name: stlite-sharing-editor path: website - name: Publish - uses: cloudflare/pages-action@1 + uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: stlite-sharing-editor - directory: website + command: pages deploy website --project-name=stlite-sharing-editor gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-desktop: From 6fbedc8b1446e302b4ceffc18c9b38d28295beda Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:38:48 +0000 Subject: [PATCH 02/14] ci: Add wrangler installation step for Cloudflare Pages deployments Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89c255dda..8e4459b42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -460,6 +460,8 @@ jobs: with: name: stlite-sharing path: website + - name: Install wrangler + run: npm install -g wrangler - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -523,6 +525,8 @@ jobs: with: name: stlite-sharing-editor path: website + - name: Install wrangler + run: npm install -g wrangler - name: Publish uses: cloudflare/wrangler-action@v3 with: From fa40d00b69650ba7a818432056931e5efcab2ec2 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:52:31 +0000 Subject: [PATCH 03/14] ci: Add branch parameter to wrangler pages deploy command Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e4459b42..9856236c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -468,7 +468,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing + command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-sharing-editor: @@ -532,7 +532,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing-editor + command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-desktop: From 0cc42592aceb319620d52203377dc7e470acb4d0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:54:31 +0000 Subject: [PATCH 04/14] ci: Add Cloudflare login step before deployment Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9856236c7..42418022c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -462,6 +462,8 @@ jobs: path: website - name: Install wrangler run: npm install -g wrangler + - name: Login to Cloudflare + run: echo "${{ secrets.CLOUDFLARE_API_TOKEN }}" | npx wrangler login - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -527,6 +529,8 @@ jobs: path: website - name: Install wrangler run: npm install -g wrangler + - name: Login to Cloudflare + run: echo "${{ secrets.CLOUDFLARE_API_TOKEN }}" | npx wrangler login - name: Publish uses: cloudflare/wrangler-action@v3 with: From ddf1edd1d207b07ab6140008877e2733ba27ff27 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:55:44 +0000 Subject: [PATCH 05/14] ci: Add Pages project creation step before deployment Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42418022c..467bb1090 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -464,6 +464,11 @@ jobs: run: npm install -g wrangler - name: Login to Cloudflare run: echo "${{ secrets.CLOUDFLARE_API_TOKEN }}" | npx wrangler login + - name: Create Pages Project (if not exists) + run: | + if ! npx wrangler pages project list | grep -q "stlite-sharing"; then + npx wrangler pages project create stlite-sharing --production-branch=main + fi - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -531,6 +536,11 @@ jobs: run: npm install -g wrangler - name: Login to Cloudflare run: echo "${{ secrets.CLOUDFLARE_API_TOKEN }}" | npx wrangler login + - name: Create Pages Project (if not exists) + run: | + if ! npx wrangler pages project list | grep -q "stlite-sharing-editor"; then + npx wrangler pages project create stlite-sharing-editor --production-branch=main + fi - name: Publish uses: cloudflare/wrangler-action@v3 with: From 1d93adc6dec849f31e9baf2b6d3a45f50923b3eb Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:56:30 +0000 Subject: [PATCH 06/14] ci: Add commit-dirty flag to wrangler pages deploy command Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 467bb1090..d677ba76c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -475,7 +475,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} + command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} --commit-dirty=true gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-sharing-editor: @@ -546,7 +546,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} + command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} --commit-dirty=true gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-desktop: From 3e359f8745f5b49d86623cd883ffb2b0d40f8065 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:09:23 +0000 Subject: [PATCH 07/14] ci: Update wrangler authentication and deployment configuration Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d677ba76c..fa175e46c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -462,9 +462,10 @@ jobs: path: website - name: Install wrangler run: npm install -g wrangler - - name: Login to Cloudflare - run: echo "${{ secrets.CLOUDFLARE_API_TOKEN }}" | npx wrangler login - name: Create Pages Project (if not exists) + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | if ! npx wrangler pages project list | grep -q "stlite-sharing"; then npx wrangler pages project create stlite-sharing --production-branch=main @@ -475,7 +476,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} --commit-dirty=true + command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-sharing-editor: @@ -534,9 +535,10 @@ jobs: path: website - name: Install wrangler run: npm install -g wrangler - - name: Login to Cloudflare - run: echo "${{ secrets.CLOUDFLARE_API_TOKEN }}" | npx wrangler login - name: Create Pages Project (if not exists) + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | if ! npx wrangler pages project list | grep -q "stlite-sharing-editor"; then npx wrangler pages project create stlite-sharing-editor --production-branch=main @@ -546,7 +548,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} --commit-dirty=true + command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} build-desktop: From d1f2eba43eaaf620348819d230d008a0bf1e7994 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:20:24 +0000 Subject: [PATCH 08/14] ci: Update wrangler authentication and deployment configuration Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa175e46c..d05b2bc79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -473,11 +473,11 @@ jobs: - name: Publish uses: cloudflare/wrangler-action@v3 id: publish + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} - gitHubToken: ${{ secrets.GITHUB_TOKEN }} + command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} --commit-dirty=true build-sharing-editor: if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4 @@ -545,11 +545,11 @@ jobs: fi - name: Publish uses: cloudflare/wrangler-action@v3 + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} - gitHubToken: ${{ secrets.GITHUB_TOKEN }} + command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} --commit-dirty=true build-desktop: if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4 From a01ec3c8ecf4621c9ab60309ee3b6e46fb87d3da Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:35:03 +0000 Subject: [PATCH 09/14] ci: Update wrangler installation to use yarn consistently Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d05b2bc79..0ef6d7ba1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -461,14 +461,14 @@ jobs: name: stlite-sharing path: website - name: Install wrangler - run: npm install -g wrangler + run: yarn global add wrangler - name: Create Pages Project (if not exists) env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | - if ! npx wrangler pages project list | grep -q "stlite-sharing"; then - npx wrangler pages project create stlite-sharing --production-branch=main + if ! yarn wrangler pages project list | grep -q "stlite-sharing"; then + yarn wrangler pages project create stlite-sharing --production-branch=main fi - name: Publish uses: cloudflare/wrangler-action@v3 @@ -534,14 +534,14 @@ jobs: name: stlite-sharing-editor path: website - name: Install wrangler - run: npm install -g wrangler + run: yarn global add wrangler - name: Create Pages Project (if not exists) env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | - if ! npx wrangler pages project list | grep -q "stlite-sharing-editor"; then - npx wrangler pages project create stlite-sharing-editor --production-branch=main + if ! yarn wrangler pages project list | grep -q "stlite-sharing-editor"; then + yarn wrangler pages project create stlite-sharing-editor --production-branch=main fi - name: Publish uses: cloudflare/wrangler-action@v3 From 0025b4ed5d7e5308ef72b916c26b03138bb22d07 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:48:50 +0000 Subject: [PATCH 10/14] ci: Use wrangler-action consistently for project creation and deployment Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ef6d7ba1..3b329baf1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -460,16 +460,13 @@ jobs: with: name: stlite-sharing path: website - - name: Install wrangler - run: yarn global add wrangler - name: Create Pages Project (if not exists) + uses: cloudflare/wrangler-action@v3 env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - run: | - if ! yarn wrangler pages project list | grep -q "stlite-sharing"; then - yarn wrangler pages project create stlite-sharing --production-branch=main - fi + with: + command: pages project list | grep -q "stlite-sharing" || pages project create stlite-sharing --production-branch=main - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -533,16 +530,13 @@ jobs: with: name: stlite-sharing-editor path: website - - name: Install wrangler - run: yarn global add wrangler - name: Create Pages Project (if not exists) + uses: cloudflare/wrangler-action@v3 env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - run: | - if ! yarn wrangler pages project list | grep -q "stlite-sharing-editor"; then - yarn wrangler pages project create stlite-sharing-editor --production-branch=main - fi + with: + command: pages project list | grep -q "stlite-sharing-editor" || pages project create stlite-sharing-editor --production-branch=main - name: Publish uses: cloudflare/wrangler-action@v3 env: From cf3f7d6bd4a3514dd20d2d00de5dd6e0afd6f746 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:49:47 +0000 Subject: [PATCH 11/14] ci: Simplify Pages project creation with wrangler-action Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b329baf1..8ae41aa4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -466,7 +466,7 @@ jobs: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages project list | grep -q "stlite-sharing" || pages project create stlite-sharing --production-branch=main + command: pages project create stlite-sharing --production-branch=main || true - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -536,7 +536,7 @@ jobs: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages project list | grep -q "stlite-sharing-editor" || pages project create stlite-sharing-editor --production-branch=main + command: pages project create stlite-sharing-editor --production-branch=main || true - name: Publish uses: cloudflare/wrangler-action@v3 env: From 9b72afbab3e2051d86664857cc271d21cd4fcfbf Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 18:02:45 +0000 Subject: [PATCH 12/14] ci: Fix Pages project creation check in wrangler-action Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ae41aa4e..3b329baf1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -466,7 +466,7 @@ jobs: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages project create stlite-sharing --production-branch=main || true + command: pages project list | grep -q "stlite-sharing" || pages project create stlite-sharing --production-branch=main - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -536,7 +536,7 @@ jobs: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages project create stlite-sharing-editor --production-branch=main || true + command: pages project list | grep -q "stlite-sharing-editor" || pages project create stlite-sharing-editor --production-branch=main - name: Publish uses: cloudflare/wrangler-action@v3 env: From d2bd6c81255c391b968a522968a137847edc64fe Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 18:16:17 +0000 Subject: [PATCH 13/14] ci: Add wrangler CLI installation step before deployment Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b329baf1..f258de821 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -460,6 +460,8 @@ jobs: with: name: stlite-sharing path: website + - name: Install wrangler + run: npm install -g wrangler - name: Create Pages Project (if not exists) uses: cloudflare/wrangler-action@v3 env: @@ -530,6 +532,8 @@ jobs: with: name: stlite-sharing-editor path: website + - name: Install wrangler + run: npm install -g wrangler - name: Create Pages Project (if not exists) uses: cloudflare/wrangler-action@v3 env: From caff8a2f0bd27451fa0c7d20dab561e1b9a21052 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 18:36:01 +0000 Subject: [PATCH 14/14] ci: Fix wrangler deployment configuration and add login step Co-Authored-By: t.yic.yt@gmail.com --- .github/workflows/main.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f258de821..467c06446 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -462,13 +462,20 @@ jobs: path: website - name: Install wrangler run: npm install -g wrangler + - name: Login to Cloudflare + uses: cloudflare/wrangler-action@v3 + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + with: + command: login - name: Create Pages Project (if not exists) uses: cloudflare/wrangler-action@v3 env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages project list | grep -q "stlite-sharing" || pages project create stlite-sharing --production-branch=main + command: pages project list | grep -q "stlite-sharing" || wrangler pages project create stlite-sharing --production-branch=main - name: Publish uses: cloudflare/wrangler-action@v3 id: publish @@ -476,7 +483,7 @@ jobs: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages deploy website --project-name=stlite-sharing --branch=${{ github.ref_name }} --commit-dirty=true + command: pages deploy --project-name=stlite-sharing website --branch=${{ github.ref_name }} --commit-dirty=true build-sharing-editor: if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4 @@ -534,20 +541,27 @@ jobs: path: website - name: Install wrangler run: npm install -g wrangler + - name: Login to Cloudflare + uses: cloudflare/wrangler-action@v3 + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + with: + command: login - name: Create Pages Project (if not exists) uses: cloudflare/wrangler-action@v3 env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages project list | grep -q "stlite-sharing-editor" || pages project create stlite-sharing-editor --production-branch=main + command: pages project list | grep -q "stlite-sharing-editor" || wrangler pages project create stlite-sharing-editor --production-branch=main - name: Publish uses: cloudflare/wrangler-action@v3 env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} with: - command: pages deploy website --project-name=stlite-sharing-editor --branch=${{ github.ref_name }} --commit-dirty=true + command: pages deploy --project-name=stlite-sharing-editor website --branch=${{ github.ref_name }} --commit-dirty=true build-desktop: if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4