Skip to content

Commit 5ca9e0a

Browse files
committed
chore: Update GitHub Actions to v4, simplify CI/CD workflows by removing OS matrices and pnpm caching, expand .dockerignore, and explicitly call sh for the build script.
1 parent def4604 commit 5ca9e0a

5 files changed

Lines changed: 24 additions & 91 deletions

File tree

‎.dockerignore‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
dist
22
.github
33
node_modules
4-
4+
.git
5+
.vscode
6+
.idea
57
*.log
6-
8+
.eslintcache
9+
.oxlintrc.json
10+
.prettierignore
11+
.prettierrc.json
712
readme.md
813
README.md
914
readme.zh.md
10-
11-
1215
docker-compose.yaml
1316
Dockerfile
17+
.DS_Store

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ on:
88

99
jobs:
1010
lint:
11-
name: Lint and Validate (${{ matrix.os }})
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
os: [ubuntu-latest, windows-latest, macos-latest]
11+
name: Lint and Validate
12+
runs-on: ubuntu-latest
1613

1714
steps:
1815
- name: Checkout code
19-
uses: actions/checkout@v6
16+
uses: actions/checkout@v4
2017

2118
- uses: pnpm/action-setup@v4
2219
name: Install pnpm
@@ -25,37 +22,21 @@ jobs:
2522
run_install: false
2623

2724
- name: Setup Node.js
28-
uses: actions/setup-node@v6
25+
uses: actions/setup-node@v4
2926
with:
3027
node-version: "22"
3128
cache: "pnpm"
3229

33-
- name: Get pnpm store directory
34-
id: pnpm-cache
35-
shell: bash
36-
run: |
37-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
38-
39-
- uses: actions/cache@v5
40-
name: Setup pnpm cache
41-
with:
42-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
43-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44-
restore-keys: |
45-
${{ runner.os }}-pnpm-store-
46-
4730
- name: Install dependencies
4831
run: pnpm install --frozen-lockfile
4932

5033
- name: Run oxlint and TypeScript checks
5134
run: pnpm run lint:ts
5235

5336
- name: Validate Docker Compose file
54-
if: matrix.os == 'ubuntu-latest'
5537
run: docker compose -f docker-compose.yaml config --quiet
5638

5739
- name: Lint Dockerfile with Hadolint
58-
if: matrix.os == 'ubuntu-latest'
5940
uses: hadolint/hadolint-action@v3.3.0
6041
with:
6142
dockerfile: Dockerfile

‎.github/workflows/docker.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v6
19+
uses: actions/checkout@v4
2020

2121
- name: Set up QEMU
2222
uses: docker/setup-qemu-action@v3

‎.github/workflows/pages-build-site.yml‎

Lines changed: 10 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ permissions:
1212

1313
concurrency:
1414
group: "pages"
15-
cancel-in-progress: false
15+
cancel-in-progress: true
1616

1717
jobs:
1818
build:
19-
name: Build (${{ matrix.os }})
20-
runs-on: ${{ matrix.os }}
21-
strategy:
22-
matrix:
23-
os: [ubuntu-latest, windows-latest, macos-latest]
19+
name: Build
20+
runs-on: ubuntu-latest
2421

2522
steps:
2623
- name: Checkout
27-
uses: actions/checkout@v6
24+
uses: actions/checkout@v4
2825

2926
- uses: pnpm/action-setup@v4
3027
name: Install pnpm
@@ -33,31 +30,22 @@ jobs:
3330
run_install: false
3431

3532
- name: Install Node.js
36-
uses: actions/setup-node@v6
33+
uses: actions/setup-node@v4
3734
with:
3835
node-version: "22"
3936
cache: "pnpm"
4037

41-
- name: Get pnpm store directory
42-
id: pnpm-cache
43-
shell: bash
44-
run: |
45-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
46-
47-
- uses: actions/cache@v5
48-
name: Setup pnpm cache
49-
with:
50-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
51-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
52-
restore-keys: |
53-
${{ runner.os }}-pnpm-store-
54-
5538
- name: Install dependencies
5639
run: pnpm install --frozen-lockfile
5740

5841
- name: Build
5942
run: pnpm build
6043

44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: "./dist"
48+
6149
deploy:
6250
name: Deploy to GitHub Pages
6351
needs: build
@@ -66,46 +54,6 @@ jobs:
6654
url: ${{ steps.deployment.outputs.page_url }}
6755
runs-on: ubuntu-latest
6856
steps:
69-
- name: Checkout
70-
uses: actions/checkout@v6
71-
72-
- uses: pnpm/action-setup@v4
73-
name: Install pnpm
74-
id: pnpm-install
75-
with:
76-
run_install: false
77-
78-
- name: Install Node.js
79-
uses: actions/setup-node@v6
80-
with:
81-
node-version: "22"
82-
cache: "pnpm"
83-
84-
- name: Get pnpm store directory
85-
id: pnpm-cache
86-
shell: bash
87-
run: |
88-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
89-
90-
- uses: actions/cache@v5
91-
name: Setup pnpm cache
92-
with:
93-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
94-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
95-
restore-keys: |
96-
${{ runner.os }}-pnpm-store-
97-
98-
- name: Install dependencies
99-
run: pnpm install --frozen-lockfile
100-
101-
- name: Build
102-
run: pnpm build
103-
104-
- name: Upload artifact
105-
uses: actions/upload-pages-artifact@v3
106-
with:
107-
path: "./dist"
108-
10957
- name: Deploy to GitHub Pages
11058
id: deployment
11159
uses: actions/deploy-pages@v4

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite --host --force",
8-
"build": "./bin/build.sh",
8+
"build": "sh ./bin/build.sh",
99
"preview": "vite preview",
1010
"tsc": "tsc --noEmit",
1111
"format": "prettier --write .",

0 commit comments

Comments
 (0)