Skip to content

Commit e5e3fb6

Browse files
committed
chore: standardize repository setup
1 parent 0169e59 commit e5e3fb6

9 files changed

Lines changed: 226 additions & 205 deletions

File tree

.github/FUNDING.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
# These are supported funding model platforms
2-
3-
github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: ant-design # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14-
thanks_dev: # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1+
github: ant-design
2+
open_collective: ant-design
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Cloudflare Pages Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
deployments: write
9+
10+
jobs:
11+
preview:
12+
runs-on: ubuntu-latest
13+
env:
14+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
15+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
16+
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
17+
PREVIEW: true
18+
steps:
19+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
20+
with:
21+
persist-credentials: false
22+
- name: Skip Cloudflare Pages preview
23+
if: ${{ env.CLOUDFLARE_API_TOKEN == '' || env.CLOUDFLARE_ACCOUNT_ID == '' || env.CLOUDFLARE_PAGES_PROJECT == '' }}
24+
run: echo "Cloudflare Pages preview is not configured; skip deployment."
25+
- name: Install dependencies
26+
if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }}
27+
run: npm install
28+
- name: Build site
29+
if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }}
30+
run: npm run build
31+
- name: Deploy preview
32+
if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }}
33+
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0
34+
with:
35+
apiToken: ${{ env.CLOUDFLARE_API_TOKEN }}
36+
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
37+
command: pages deploy dist --project-name=${{ env.CLOUDFLARE_PAGES_PROJECT }} --branch=${{ github.head_ref }}
38+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/react-component-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ name: ✅ test
22
on: [push, pull_request]
33
jobs:
44
test:
5-
uses: react-component/rc-test/.github/workflows/test.yml@main
6-
secrets: inherit
5+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
6+
secrets: inherit

.github/workflows/react-doctor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: React Doctor
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
push:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
issues: write
13+
statuses: write
14+
15+
concurrency:
16+
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
react-doctor:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
24+
with:
25+
fetch-depth: 0
26+
persist-credentials: false
27+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Surge Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
checks: write
10+
statuses: write
11+
12+
jobs:
13+
preview:
14+
runs-on: ubuntu-latest
15+
env:
16+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
17+
PREVIEW: true
18+
steps:
19+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
20+
with:
21+
persist-credentials: false
22+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
23+
if: ${{ env.SURGE_TOKEN != '' }}
24+
with:
25+
surge_token: ${{ env.SURGE_TOKEN }}
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
dist: dist
28+
failOnError: true
29+
setCommitStatus: true
30+
build: |
31+
npm install
32+
npm run build
33+
- name: Skip Surge preview
34+
if: ${{ env.SURGE_TOKEN == '' }}
35+
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

0 commit comments

Comments
 (0)