diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf0f0fd..5e9e1bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -24,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: corepack enable diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 24716d9..699dd5e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: Docs +name: Publish Docs on: push: @@ -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 }} diff --git a/package.json b/package.json index 41c9f2d..9d6c6fc 100644 --- a/package.json +++ b/package.json @@ -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", @@ -80,5 +81,5 @@ "node-fetch": "npm:node-fetch-native@latest" } }, - "packageManager": "pnpm@8.6.7" + "packageManager": "pnpm@8.9.2" } diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh index 2dde637..18db667 100755 --- a/scripts/deploy-docs.sh +++ b/scripts/deploy-docs.sh @@ -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"