Skip to content

Commit ab7c8ae

Browse files
authored
feat: migrate to Cloudflare pages (#11)
1 parent ebe0401 commit ab7c8ae

14 files changed

Lines changed: 72 additions & 296 deletions
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: cloudflare-pages-deploy
2+
3+
on:
4+
schedule:
5+
# Twice daily: 01:00 UTC (09:00 Beijing) and 13:00 UTC (21:00 Beijing)
6+
- cron: '0 1,13 * * *'
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: cloudflare-pages-deploy
11+
cancel-in-progress: true
12+
13+
jobs:
14+
trigger:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Trigger Cloudflare Pages Deploy Hook
18+
env:
19+
CLOUDFLARE_PAGES_DEPLOY_HOOK_URL: ${{ secrets.CLOUDFLARE_PAGES_DEPLOY_HOOK_URL }}
20+
run: |
21+
if [ -z "$CLOUDFLARE_PAGES_DEPLOY_HOOK_URL" ]; then
22+
echo "Missing secret CLOUDFLARE_PAGES_DEPLOY_HOOK_URL" >&2
23+
exit 1
24+
fi
25+
26+
curl -sS -X POST "$CLOUDFLARE_PAGES_DEPLOY_HOOK_URL" -o /dev/null -w "HTTP %{http_code}\n"

.github/workflows/rspress-ecosystem-ci-from-commit.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ jobs:
5656
env:
5757
ECOSYSTEM_CI_REF: ${{ inputs.commitSHA }}
5858
ECOSYSTEM_CI_TYPE: 'commit'
59-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
60-
RSBUILD_NETLIFY_SITE_ID: ${{ secrets.RSBUILD_NETLIFY_SITE_ID }}
61-
RSLIB_NETLIFY_SITE_ID: ${{ secrets.RSLIB_NETLIFY_SITE_ID }}
62-
RSPACK_NETLIFY_SITE_ID: ${{ secrets.RSPACK_NETLIFY_SITE_ID }}
63-
RSTEST_NETLIFY_SITE_ID: ${{ secrets.RSTEST_NETLIFY_SITE_ID }}
6459
steps:
6560
- uses: actions/checkout@v5
6661
- uses: ./.github/actions/build-rspress
@@ -96,11 +91,6 @@ jobs:
9691
env:
9792
ECOSYSTEM_CI_REF: ${{ inputs.commitSHA }}
9893
ECOSYSTEM_CI_TYPE: 'commit'
99-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
100-
RSBUILD_NETLIFY_SITE_ID: ${{ secrets.RSBUILD_NETLIFY_SITE_ID }}
101-
RSLIB_NETLIFY_SITE_ID: ${{ secrets.RSLIB_NETLIFY_SITE_ID }}
102-
RSPACK_NETLIFY_SITE_ID: ${{ secrets.RSPACK_NETLIFY_SITE_ID }}
103-
RSTEST_NETLIFY_SITE_ID: ${{ secrets.RSTEST_NETLIFY_SITE_ID }}
10494
steps:
10595
- uses: actions/checkout@v5
10696
- uses: moonrepo/setup-rust@v1

.github/workflows/rspress-ecosystem-ci-from-pr.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ jobs:
5353
execute-selected-suite:
5454
runs-on: ubuntu-latest
5555
if: "inputs.suite != '-'"
56-
env:
57-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
58-
RSBUILD_NETLIFY_SITE_ID: ${{ secrets.RSBUILD_NETLIFY_SITE_ID }}
59-
RSLIB_NETLIFY_SITE_ID: ${{ secrets.RSLIB_NETLIFY_SITE_ID }}
60-
RSPACK_NETLIFY_SITE_ID: ${{ secrets.RSPACK_NETLIFY_SITE_ID }}
61-
RSTEST_NETLIFY_SITE_ID: ${{ secrets.RSTEST_NETLIFY_SITE_ID }}
6256
steps:
6357
- uses: actions/checkout@v5
6458
- uses: ./.github/actions/build-rspress
@@ -91,12 +85,6 @@ jobs:
9185
fail-fast: false
9286
runs-on: ${{ matrix.os }}
9387
name: execute-all (${{ matrix.suite }})
94-
env:
95-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
96-
RSBUILD_NETLIFY_SITE_ID: ${{ secrets.RSBUILD_NETLIFY_SITE_ID }}
97-
RSLIB_NETLIFY_SITE_ID: ${{ secrets.RSLIB_NETLIFY_SITE_ID }}
98-
RSPACK_NETLIFY_SITE_ID: ${{ secrets.RSPACK_NETLIFY_SITE_ID }}
99-
RSTEST_NETLIFY_SITE_ID: ${{ secrets.RSTEST_NETLIFY_SITE_ID }}
10088
steps:
10189
- uses: actions/checkout@v5
10290
- uses: ./.github/actions/build-rspress

.github/workflows/rspress-ecosystem-ci-selected.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ jobs:
5959
execute-selected-suite:
6060
runs-on: ubuntu-latest
6161
if: "inputs.suite != '-'"
62-
env:
63-
ECOSYSTEM_CI_REF: ${{ inputs.ref }}
64-
ECOSYSTEM_CI_TYPE: 'branch'
65-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
66-
RSBUILD_NETLIFY_SITE_ID: ${{ secrets.RSBUILD_NETLIFY_SITE_ID }}
67-
RSLIB_NETLIFY_SITE_ID: ${{ secrets.RSLIB_NETLIFY_SITE_ID }}
68-
RSPACK_NETLIFY_SITE_ID: ${{ secrets.RSPACK_NETLIFY_SITE_ID }}
69-
RSTEST_NETLIFY_SITE_ID: ${{ secrets.RSTEST_NETLIFY_SITE_ID }}
7062
steps:
7163
- uses: actions/checkout@v5
7264
- uses: ./.github/actions/build-rspress
@@ -85,14 +77,6 @@ jobs:
8577
8678
execute-all:
8779
if: "inputs.suite == '-'"
88-
env:
89-
ECOSYSTEM_CI_REF: ${{ inputs.ref }}
90-
ECOSYSTEM_CI_TYPE: 'branch'
91-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
92-
RSBUILD_NETLIFY_SITE_ID: ${{ secrets.RSBUILD_NETLIFY_SITE_ID }}
93-
RSLIB_NETLIFY_SITE_ID: ${{ secrets.RSLIB_NETLIFY_SITE_ID }}
94-
RSPACK_NETLIFY_SITE_ID: ${{ secrets.RSPACK_NETLIFY_SITE_ID }}
95-
RSTEST_NETLIFY_SITE_ID: ${{ secrets.RSTEST_NETLIFY_SITE_ID }}
9680
strategy:
9781
matrix:
9882
include:

netlify.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

netlify/functions/trigger-deploy.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/rspress/rsbuild.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
3-
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
4-
5-
const SITE_ID_ENV = 'RSBUILD_NETLIFY_SITE_ID';
63

74
export async function test(options: RunOptions) {
85
await runInRepo({
@@ -12,14 +9,6 @@ export async function test(options: RunOptions) {
129
beforeTest: async () => {
1310
cd('./website');
1411
},
15-
test: [
16-
'build',
17-
async () => {
18-
await deployPreviewToNetlify({
19-
message: MESSAGE,
20-
siteIdEnvVar: SITE_ID_ENV,
21-
});
22-
},
23-
],
12+
test: ['build'],
2413
});
2514
}

tests/rspress/rslib.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
3-
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
4-
5-
const SITE_ID_ENV = 'RSLIB_NETLIFY_SITE_ID';
63

74
export async function test(options: RunOptions) {
85
await runInRepo({
@@ -12,14 +9,6 @@ export async function test(options: RunOptions) {
129
beforeTest: async () => {
1310
cd('./website');
1411
},
15-
test: [
16-
'build',
17-
async () => {
18-
await deployPreviewToNetlify({
19-
message: MESSAGE,
20-
siteIdEnvVar: SITE_ID_ENV,
21-
});
22-
},
23-
],
12+
test: ['build'],
2413
});
2514
}

tests/rspress/rspack.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
3-
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
4-
5-
const SITE_ID_ENV = 'RSPACK_NETLIFY_SITE_ID';
63

74
export async function test(options: RunOptions) {
85
await runInRepo({
@@ -12,14 +9,6 @@ export async function test(options: RunOptions) {
129
beforeTest: async () => {
1310
cd('./website');
1411
},
15-
test: [
16-
'pnpm run build',
17-
async () => {
18-
await deployPreviewToNetlify({
19-
message: MESSAGE,
20-
siteIdEnvVar: SITE_ID_ENV,
21-
});
22-
},
23-
],
12+
test: ['pnpm run build'],
2413
});
2514
}

tests/rspress/rstest.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
3-
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
4-
5-
const SITE_ID_ENV = 'RSTEST_NETLIFY_SITE_ID';
63

74
export async function test(options: RunOptions) {
85
await runInRepo({
@@ -12,14 +9,6 @@ export async function test(options: RunOptions) {
129
beforeTest: async () => {
1310
cd('./website');
1411
},
15-
test: [
16-
'build',
17-
async () => {
18-
await deployPreviewToNetlify({
19-
message: MESSAGE,
20-
siteIdEnvVar: SITE_ID_ENV,
21-
});
22-
},
23-
],
12+
test: ['build'],
2413
});
2514
}

0 commit comments

Comments
 (0)