Skip to content

Commit 085ce2e

Browse files
committed
ci/cd
1 parent e97158a commit 085ce2e

File tree

5 files changed

+66
-1
lines changed

5 files changed

+66
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check code style and quality
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 8
18+
- name: Use Node.js 16
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 16
22+
cache: "pnpm"
23+
- name: install
24+
run: pnpm install
25+
- name: ESLint
26+
run: pnpm run lint
27+
- name: Prettier
28+
run: pnpm run prettier:check
29+
- name: Typescript
30+
run: pnpm run types

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout your repository using git
18+
uses: actions/checkout@v3
19+
- name: Install, build, and upload your site
20+
uses: withastro/action@v0
21+
with:
22+
node-version: 16
23+
24+
deploy:
25+
needs: build
26+
runs-on: ubuntu-latest
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
steps:
31+
- name: Deploy to GitHub Pages
32+
id: deployment
33+
uses: actions/deploy-pages@v2

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"preview": "astro preview",
99
"types": "astro check && tsc --noEmit",
1010
"prettier": "prettier --write . --plugin=prettier-plugin-astro",
11+
"prettier:check": "prettier --check . --plugin=prettier-plugin-astro",
1112
"lint": "eslint --ext .js,.astro src"
1213
},
1314
"dependencies": {

src/components/Excerpt.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { body } = post;
1111
const cleaned = body
1212
.replace(/\|.*\|/gm, "") // remove tables
1313
.replace(/[#*]+.*$/gm, "") // remove markdown headings
14-
.replace(/\[([^\]]+)\]\([^\)]+\)/gm, "$1") // replace markdown links with link text
14+
.replace(/\[([^\]]+)\]\([^)]+\)/gm, "$1") // replace markdown links with link text
1515
.replace(/<[^>]*>?/gm, ""); // remove html tags
1616
1717
const excerpt = cleaned.split(/\s/).slice(0, 60).join(" ") + "...";

0 commit comments

Comments
 (0)