Skip to content

Commit

Permalink
chore: test docs release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Nov 27, 2023
1 parent c051c2f commit c6020c7
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 30 deletions.
28 changes: 28 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'setup'
description: Prepare the environment

runs:
using: composite
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false

- name: Setup pnpm config
run: pnpm config set store-dir .pnpm-store

- name: Install dependencies
run: pnpm install
25 changes: 25 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy docs
on:
push:
branches:
- dev

jobs:
release:
name: deploy docs
if: github.repository == 'node-real/walletkit'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup

- name: Build docs
run: pnpm build:docs

- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./website/dist
branch: 'docs'
clean: true
force: true
33 changes: 4 additions & 29 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,17 @@ on:
- main
- 0.x

env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
release:
name: release
if: github.repository == 'node-real/walletkit'
timeout-minutes: 15
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false
- name: Build packages
run: pnpm build

- name: Creating .npmrc
run: |
Expand All @@ -41,15 +25,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm --filter "@totejs/**" build

- name: Create and publish versions
uses: changesets/action@v1
with:
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"scripts": {
"prepare": "husky install",
"lint": "pnpm eslint .",
"dev": "pnpm --filter @totejs/walletkit dev",
"dev": "pnpm --F @totejs/walletkit dev",
"build": "pnpm --F @totejs/walletkit build",
"dev:docs": "pnpm --F @totejs/walletkit build:watch & pnpm --F website dev",
"build:docs": "pnpm --F @totejs/walletkit build && pnpm --F website build",
"ci:version": "pnpm changeset version && pnpm install && cp README.md packages/walletkit/README.md",
"ci:publish": "pnpm publish -r"
},
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "node-real",
"private": true,
"type": "module",
"homepage": "https://node-real.github.io/walletkit",
"scripts": {
"dev": "vite --host 0.0.0.0",
"build": "tsc && vite build"
Expand Down

0 comments on commit c6020c7

Please sign in to comment.