fix: fix demo lockfile #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs | |
env: | |
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }} | |
ENABLE_DOCS: ${{ secrets.ENABLE_DOCS }} | |
on: | |
push: | |
branches: [ master ] | |
repository_dispatch: | |
types: [ docs ] | |
jobs: | |
docs: | |
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: ["latest"] | |
steps: | |
# region Setup | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
name: Setting Up Node.js (${{ matrix.node-version }}) | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: latest | |
- name: Get Pnpm Cache Path | |
id: pnpm-cache | |
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: "echo Cache Key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}" | |
- run: "echo Cache Restore-Keys: ${{ runner.os }}-pnpm-store-" | |
- run: "echo Pnpm Cache Hit: ${{ steps.pnpm-cache.outputs.cache-hit }}" | |
- run: pnpm install --frozen-lockfile | |
if: "env.USE_LOCKFILE == 'true'" | |
- run: pnpm install --no-lockfile | |
if: "env.USE_LOCKFILE != 'true'" | |
# regionend | |
# region Steps | |
- run: pnpm build | |
- run: pnpm lint | |
- run: pnpm test | |
- run: pnpm doc | |
- run: pnpm install --frozen-lockfile | |
working-directory: demo | |
- run: pnpm demo:build | |
- name: Documentation | |
if: "env.ENABLE_DOCS == 'true'" | |
uses: crazy-max/ghaction-github-pages@v4 | |
with: | |
jekyll: false | |
target_branch: gh-pages | |
build_dir: docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: echo "env.ENABLE_DOCS is ${{ env.ENABLE_DOCS }}, no documentation can be published" && exit 1 | |
if: "env.ENABLE_DOCS != 'true'" | |
# regionend |