Skip to content

Commit

Permalink
chore: add docs deployment workflow and update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwep committed Jan 18, 2025
1 parent f4330ce commit 7b4dd98
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 8 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy Docs

on:
push:
branches: [master]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build docs
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: 9.15.0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build libraries
run: pnpm build

- name: Build docs
run: pnpm docs:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-22.04
name: Deploy
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
45 changes: 38 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on: ["push", "pull_request"]
jobs:
build:
name: Build, test and eventually publish
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Checkout
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: 9.11.0
version: 9.15.0

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

- name: Lint
run: pnpm run lint
run: pnpm lint

- name: Build
run: pnpm run build
- name: Build packages
run: pnpm build

- name: Build docs
run: pnpm docs:build

- name: Publish
if: startsWith(github.event.ref, 'refs/tags/v')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx lerna publish from-package --yes

publish_release:
if: startsWith(github.event.ref, 'refs/tags/v')
name: Publish new release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Extract changes
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}

- name: Publish release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.changelog.outputs.changes }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@

### Getting started

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

* [@viselect/vanilla](packages/vanilla) - To be used with plain [JavaScript](http://vanilla-js.com/) or [TypeScript](https://www.typescriptlang.org/).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Simon Reinisch <[email protected]>",
"private": true,
"license": "MIT",
"packageManager": "pnpm@9.11.0",
"packageManager": "pnpm@9.15.0",
"engines": {
"node": "^22"
},
Expand Down

0 comments on commit 7b4dd98

Please sign in to comment.