-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbea0de
commit d33aa57
Showing
2 changed files
with
67 additions
and
37 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,32 +23,36 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Detect package manager | ||
id: detect-package-manager | ||
run: | | ||
echo "manager=pnpm" >> $GITHUB_OUTPUT | ||
echo "command=install --frozen-lockfile" >> $GITHUB_OUTPUT | ||
echo "runner=pnpm" >> $GITHUB_OUTPUT | ||
exit 0 | ||
- name: Setup Node | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
cache: ${{ steps.detect-package-manager.outputs.manager }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
node-version: "20" | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
with: | ||
path: | | ||
~/.npm | ||
~/.cache/pnpm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
with: | ||
static_site_generator: next | ||
|
||
- name: Restore cache | ||
uses: actions/cache@v3 | ||
with: | ||
|
@@ -57,15 +61,19 @@ jobs: | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml') }}- | ||
- name: Install dependencies | ||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} | ||
run: pnpm install | ||
|
||
- name: Build with Next.js | ||
run: ${{ steps.detect-package-manager.outputs.runner }} next build | ||
run: pnpm next build | ||
|
||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-files | ||
path: ./out/_next/static/chunks | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,22 +5,44 @@ on: | |
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
cache-and-install: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm lint | ||
- run: pnpm build | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Lint | ||
run: pnpm run lint | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
|