Skip to content

ci: cache

ci: cache #49

Workflow file for this run

name: CI
on:
push:
branches: [main]
jobs:
pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js latest
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Cache
uses: actions/cache@v4
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install
run: pnpm i
- name: Build
run: pnpm build
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
external_repository: Debbl/tools.aiwan.run
exclude_assets: ".github, .nojekyll"
publish_branch: main
publish_dir: out
destination_dir: code-diff