Skip to content

Commit

Permalink
chore: update docs action
Browse files Browse the repository at this point in the history
  • Loading branch information
Diizzayy committed Oct 27, 2023
1 parent 3f22d6b commit 5736a9d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
- main
paths-ignore:
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:

jobs:
Expand All @@ -24,7 +26,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- run: corepack enable

Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs
name: Publish Docs

on:
push:
Expand All @@ -24,26 +24,21 @@ jobs:
os: [ubuntu-latest]
node: [18]

defaults:
run:
working-directory: docs

steps:
- uses: actions/checkout@v4

- run: corepack enable

- uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node }}

- name: Install dependencies 👨🏻‍💻
run: pnpm

- name: Generate Docs
run: pnpm generate
run: pnpm install

- name: Deploy To Firebase
run: ../scripts/deploy-docs.sh
run: ./scripts/deploy-docs.sh
shell: bash
env:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
],
"scripts": {
"prepack": "pnpm build",
"build": "nuxt-module-build",
"prepare": "pnpm dev:prepare",
"build": "nuxt-module-build build",
"example": "./scripts/example.sh dev",
"example:build": "./scripts/example.sh build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground",
"docs:dev": "nuxi dev docs",
"docs:generate": "nuxi generate docs",
"test": "pnpm dev:prepare && nuxi prepare examples/basic && nuxi prepare examples/multi-client && vitest run",
Expand Down Expand Up @@ -80,5 +81,5 @@
"node-fetch": "npm:node-fetch-native@latest"
}
},
"packageManager": "pnpm@8.6.7"
"packageManager": "pnpm@8.9.2"
}
5 changes: 2 additions & 3 deletions scripts/deploy-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
curl -sL firebase.tools | bash

cd ./docs
pnpm i
pnpm generate
firebase use --add "$PROJECT_ID"
firebase deploy --only hosting --message "$COMMIT_MESSAGE"
firebase use --add "$PROJECT_ID" --token "$FIREBASE_TOKEN"
firebase deploy --only hosting --message "$COMMIT_MESSAGE" --token "$FIREBASE_TOKEN"

0 comments on commit 5736a9d

Please sign in to comment.