Skip to content

Commit fa7d8fc

Browse files
committed
modify: Update build workflow and remove Cloudflare connection debug steps
1 parent cdb716a commit fa7d8fc

File tree

4 files changed

+2
-32
lines changed

4 files changed

+2
-32
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,9 @@ jobs:
1818
cd my-app
1919
npm i
2020
npm run build
21-
# 技術修改:為了符合 /2024 路徑,建立對應目錄結構
2221
mkdir -p deploy/2024
2322
cp -r build/* deploy/2024/
2423
25-
- name: Debug Cloudflare Connection
26-
env:
27-
CF_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
28-
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
29-
run: |
30-
echo "=== [Step 1] 驗證 Token 是否有效 ==="
31-
curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
32-
-H "Authorization: Bearer $CF_TOKEN" \
33-
-H "Content-Type:application/json" | jq .
34-
35-
echo "=== [Step 2] 列出此 Token 有權限存取的帳號清單 ==="
36-
# 這會顯示你的 Token 到底能看到哪些 Account ID
37-
curl -s -X GET "https://api.cloudflare.com/client/v4/accounts" \
38-
-H "Authorization: Bearer $CF_TOKEN" \
39-
-H "Content-Type:application/json" | jq '.result[] | {name: .name, id: .id}'
40-
41-
echo "=== [Step 3] 檢查目標專案是否存在於該帳號下 ==="
42-
# 如果這步噴出 400/404,代表 Step 2 找出的 ID 與你填寫的 CF_ACCOUNT_ID 不符
43-
curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/pages/projects" \
44-
-H "Authorization: Bearer $CF_TOKEN" \
45-
-H "Content-Type:application/json" | jq '.result[]?.name'
46-
4724
- name: Deploy to Cloudflare Pages
4825
uses: cloudflare/pages-action@v1
4926
with:

my-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "my-app",
33
"version": "0.1.0",
44
"private": true,
5+
"homepage": "/2024",
56
"dependencies": {
67
"@testing-library/jest-dom": "^5.16.5",
78
"@testing-library/react": "^13.4.0",

my-app/public/index.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121
/>
2222
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
2323
<!---->
24-
<script>
25-
if (
26-
document.location.href != "https://camp.csie.cool/" &&
27-
document.location.href != "http://localhost:3000/"
28-
) {
29-
document.location.href = "https://camp.csie.cool/";
30-
}
31-
</script>
3224

3325
<!-- Clarity -->
3426
<script type="text/javascript">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"bugs": {
1717
"url": "https://github.com/CSIE-Camp/website-frontend/issues"
1818
},
19-
"homepage": "/2024",
19+
"homepage": "https://github.com/CSIE-Camp/website-frontend#readme",
2020
"dependencies": {
2121
"react-bootstrap": "^2.7.2",
2222
"styled-components": "^5.3.6"

0 commit comments

Comments
 (0)