Skip to content

Commit 540eda6

Browse files
authored
Update build and deploy pipeline (#1)
- Updated build and deploy pipeline to consists of two jobs. - Updated dependencies.
1 parent 578fa1c commit 540eda6

File tree

4 files changed

+376
-337
lines changed

4 files changed

+376
-337
lines changed

.github/workflows/build-and-deploy.yaml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,64 @@
1-
name: Publish contents to GitHub pages.
1+
name: Build and deploy contents to Pages
22

33
on:
44
push:
55
branches: ['main']
6+
pull_request:
67
workflow_dispatch:
78

89
permissions:
910
contents: write
1011

11-
concurrency:
12-
group: 'pages'
13-
cancel-in-progress: true
14-
1512
jobs:
16-
build-and-deploy:
13+
build:
14+
name: Build
1715
runs-on: ubuntu-latest
1816

1917
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v4
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v2
22+
with:
23+
version: 8
2224

2325
- name: Use Node 18.x
2426
uses: actions/setup-node@v3
2527
with:
2628
node-version: 18
27-
cache: 'npm'
29+
cache: 'pnpm'
2830

2931
- name: Install and build
3032
run: |
31-
npm install
32-
npm run build
33+
pnpm install
34+
pnpm lint
35+
pnpm build
36+
37+
- name: Upload deployment build files
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: deployment-files
41+
path: ./dist
42+
43+
deploy:
44+
name: Deploy
45+
needs: build
46+
runs-on: ubuntu-latest
47+
if: github.ref == 'refs/heads/main'
48+
concurrency:
49+
group: ${{ github.workflow }}-${{ github.ref }}
50+
cancel-in-progress: true
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Download artifact
56+
uses: actions/download-artifact@v3
57+
with:
58+
name: deployment-files
59+
path: ./dist
3360

34-
- name: Host static page in gh-pages
61+
- name: Host in GitHub Pages
3562
uses: JamesIves/github-pages-deploy-action@v4
3663
with:
3764
branch: gh-pages

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"react-dom": "^18.2.0"
1616
},
1717
"devDependencies": {
18-
"@types/react": "^18.2.39",
18+
"@types/react": "^18.2.41",
1919
"@types/react-dom": "^18.2.17",
2020
"@typescript-eslint/eslint-plugin": "^6.13.1",
2121
"@typescript-eslint/parser": "^6.13.1",
2222
"@vitejs/plugin-react-swc": "^3.5.0",
23-
"eslint": "^8.54.0",
24-
"eslint-config-prettier": "^9.0.0",
23+
"eslint": "^8.55.0",
24+
"eslint-config-prettier": "^9.1.0",
2525
"eslint-plugin-prettier": "^5.0.1",
2626
"eslint-plugin-react": "^7.33.2",
2727
"eslint-plugin-react-hooks": "^4.6.0",
28-
"eslint-plugin-react-refresh": "^0.4.4",
28+
"eslint-plugin-react-refresh": "^0.4.5",
2929
"prettier": "^3.1.0",
3030
"sass": "^1.69.5",
3131
"typescript": "^5.3.2",

0 commit comments

Comments
 (0)