Skip to content

Commit 768a5c5

Browse files
committed
fix: token
1 parent 0509450 commit 768a5c5

File tree

8 files changed

+41
-7
lines changed

8 files changed

+41
-7
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ 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 }}
5964
steps:
6065
- uses: actions/checkout@v5
6166
- uses: ./.github/actions/build-rspress
@@ -91,6 +96,11 @@ jobs:
9196
env:
9297
ECOSYSTEM_CI_REF: ${{ inputs.commitSHA }}
9398
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 }}
94104
steps:
95105
- uses: actions/checkout@v5
96106
- uses: moonrepo/setup-rust@v1

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ 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 }}
5662
steps:
5763
- uses: actions/checkout@v5
5864
- uses: ./.github/actions/build-rspress
@@ -85,6 +91,12 @@ jobs:
8591
fail-fast: false
8692
runs-on: ${{ matrix.os }}
8793
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 }}
88100
steps:
89101
- uses: actions/checkout@v5
90102
- uses: ./.github/actions/build-rspress

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ jobs:
6262
env:
6363
ECOSYSTEM_CI_REF: ${{ inputs.ref }}
6464
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 }}
6570
steps:
6671
- uses: actions/checkout@v5
6772
- uses: ./.github/actions/build-rspress
@@ -83,6 +88,11 @@ jobs:
8388
env:
8489
ECOSYSTEM_CI_REF: ${{ inputs.ref }}
8590
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 }}
8696
strategy:
8797
matrix:
8898
include:

tests/rspress/rsbuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
33
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
44

5-
const SITE_ID_ENV = 'RSPRESS_NETLIFY_SITE_ID_RSBUILD';
5+
const SITE_ID_ENV = 'RSBUILD_NETLIFY_SITE_ID';
66

77
export async function test(options: RunOptions) {
88
await runInRepo({

tests/rspress/rslib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
33
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
44

5-
const SITE_ID_ENV = 'RSPRESS_NETLIFY_SITE_ID_RSLIB';
5+
const SITE_ID_ENV = 'RSLIB_NETLIFY_SITE_ID';
66

77
export async function test(options: RunOptions) {
88
await runInRepo({

tests/rspress/rspack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
33
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
44

5-
const SITE_ID_ENV = 'RSPRESS_NETLIFY_SITE_ID_RSPACK';
5+
const SITE_ID_ENV = 'RSPACK_NETLIFY_SITE_ID';
66

77
export async function test(options: RunOptions) {
88
await runInRepo({

tests/rspress/rstest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { RunOptions } from '../../types';
22
import { cd, runInRepo } from '../../utils';
33
import { MESSAGE, deployPreviewToNetlify } from './utils/_netlify';
44

5-
const SITE_ID_ENV = 'RSPRESS_NETLIFY_SITE_ID_RSTEST';
5+
const SITE_ID_ENV = 'RSTEST_NETLIFY_SITE_ID';
66

77
export async function test(options: RunOptions) {
88
await runInRepo({

tests/rspress/utils/_netlify.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ interface DeployOptions {
77
siteIdEnvVar?: string;
88
}
99

10-
const DEFAULT_OUTPUT_DIR = 'dist';
11-
const DEFAULT_NETLIFY_CLI = 'netlify-cli@17.38.1';
10+
const DEFAULT_OUTPUT_DIR = './website/doc_build';
11+
const DEFAULT_NETLIFY_CLI = 'netlify-cli@23.10.0';
1212
const DEFAULT_ALIAS = process.env.RSPRESS_NETLIFY_ALIAS ?? 'ecosystem-ci';
1313
export const MESSAGE = `${process.env.ECOSYSTEM_CI_TYPE}:${process.env.ECOSYSTEM_CI_REF}`;
1414

@@ -36,9 +36,11 @@ export async function deployPreviewToNetlify(options: DeployOptions) {
3636
return;
3737
}
3838

39+
console.log(`[rspress][netlify] Deploying with alias: ${alias}`);
40+
3941
const cliSpecifier = process.env.RSPRESS_NETLIFY_CLI ?? DEFAULT_NETLIFY_CLI;
4042
const result =
41-
await $`pnpm dlx ${cliSpecifier} deploy --dir=${outputDir} --alias=${alias} --message=${message} --site=${siteId} --confirm --json`;
43+
await $`pnpm --package=${cliSpecifier} dlx netlify deploy --dir=${outputDir} --alias=${alias} --message=${message} --site=${siteId} --auth=${authToken} --json`;
4244

4345
try {
4446
const parsed = JSON.parse(result);

0 commit comments

Comments
 (0)