Skip to content

Commit 7b4dd98

Browse files
committed
chore: add docs deployment workflow and update workflows
1 parent f4330ce commit 7b4dd98

File tree

4 files changed

+106
-8
lines changed

4 files changed

+106
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
name: Build docs
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up pnpm
27+
uses: pnpm/action-setup@v3
28+
with:
29+
version: 9.15.0
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
cache: pnpm
36+
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v4
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Build libraries
44+
run: pnpm build
45+
46+
- name: Build docs
47+
run: pnpm docs:build
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: docs/.vitepress/dist
53+
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
needs: build
59+
runs-on: ubuntu-22.04
60+
name: Deploy
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
uses: actions/deploy-pages@v4

.github/workflows/main.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ on: ["push", "pull_request"]
55
jobs:
66
build:
77
name: Build, test and eventually publish
8-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-22.04
99
env:
1010
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: pnpm/action-setup@v3
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up pnpm
16+
uses: pnpm/action-setup@v3
1417
with:
15-
version: 9.11.0
18+
version: 9.15.0
1619

1720
- name: Set up Node.js
1821
uses: actions/setup-node@v4
@@ -31,13 +34,41 @@ jobs:
3134
key: ${{ runner.os }}-eslint-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.mjs') }}
3235

3336
- name: Lint
34-
run: pnpm run lint
37+
run: pnpm lint
3538

36-
- name: Build
37-
run: pnpm run build
39+
- name: Build packages
40+
run: pnpm build
41+
42+
- name: Build docs
43+
run: pnpm docs:build
3844

3945
- name: Publish
4046
if: startsWith(github.event.ref, 'refs/tags/v')
4147
env:
4248
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4349
run: npx lerna publish from-package --yes
50+
51+
publish_release:
52+
if: startsWith(github.event.ref, 'refs/tags/v')
53+
name: Publish new release
54+
needs: build
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Set up Node.js
61+
uses: actions/setup-node@v4
62+
63+
- name: Extract changes
64+
id: changelog
65+
uses: requarks/changelog-action@v1
66+
with:
67+
token: ${{ github.token }}
68+
tag: ${{ github.ref_name }}
69+
70+
- name: Publish release
71+
uses: softprops/action-gh-release@v1
72+
if: startsWith(github.ref, 'refs/tags/')
73+
with:
74+
body: ${{ steps.changelog.outputs.changes }}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151

5252
### Getting started
5353

54+
> [!NOTE]
55+
> I'm currently in the middle of moving the migration from readmes to a new docs websites.
56+
> Stay tuned for a better, more detailed documentation in the coming weeks!
57+
5458
Check out the documentation for the package you want to use:
5559

5660
* [@viselect/vanilla](packages/vanilla) - To be used with plain [JavaScript](http://vanilla-js.com/) or [TypeScript](https://www.typescriptlang.org/).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "Simon Reinisch <[email protected]>",
44
"private": true,
55
"license": "MIT",
6-
"packageManager": "pnpm@9.11.0",
6+
"packageManager": "pnpm@9.15.0",
77
"engines": {
88
"node": "^22"
99
},

0 commit comments

Comments
 (0)