Skip to content

Commit 5379cb2

Browse files
authored
ci: deploy site on releases (#1378)
1 parent 32ee1c0 commit 5379cb2

File tree

2 files changed

+47
-43
lines changed

2 files changed

+47
-43
lines changed

.github/workflows/site.yaml

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,4 @@ jobs:
4141
run: npm run lint
4242

4343
- name: 👷 Build website
44-
run: npm run build
45-
46-
deploy:
47-
needs: build
48-
49-
runs-on: ubuntu-latest
50-
51-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
52-
53-
defaults:
54-
run:
55-
working-directory: site
56-
57-
steps:
58-
- name: 📚 Git Checkout
59-
uses: actions/checkout@v5
60-
61-
- name: ⚙️ Setup Node
62-
uses: actions/setup-node@v5
63-
with:
64-
node-version: 18.x
65-
cache: npm
66-
cache-dependency-path: site/package-lock.json
67-
68-
- name: 📦 Install Dependencies
69-
run: npm ci
70-
71-
- name: ✨ Check Format
72-
run: npm run format:check
73-
74-
- name: 🧹 Lint
75-
run: npm run lint
76-
77-
- name: 👷 Build website
78-
run: npm run build
79-
80-
- name: ☁️ Deploy to GitHub Pages
81-
uses: peaceiris/actions-gh-pages@v4
82-
with:
83-
github_token: ${{ secrets.GITHUB_TOKEN }}
84-
publish_dir: ./site/build
85-
user_name: github-actions[bot]
86-
user_email: 41898282+github-actions[bot]@users.noreply.github.com
44+
run: npm run build

.github/workflows/site_deploy.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: site_deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
13+
defaults:
14+
run:
15+
working-directory: site
16+
17+
steps:
18+
- name: 📚 Git Checkout
19+
uses: actions/checkout@v5
20+
21+
- name: ⚙️ Setup Node
22+
uses: actions/setup-node@v5
23+
with:
24+
node-version: 18.x
25+
cache: npm
26+
cache-dependency-path: site/package-lock.json
27+
28+
- name: 📦 Install Dependencies
29+
run: npm ci
30+
31+
- name: ✨ Check Format
32+
run: npm run format:check
33+
34+
- name: 🧹 Lint
35+
run: npm run lint
36+
37+
- name: 👷 Build website
38+
run: npm run build
39+
40+
- name: ☁️ Deploy to GitHub Pages
41+
uses: peaceiris/actions-gh-pages@v4
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: ./site/build
45+
user_name: github-actions[bot]
46+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)