Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-bauer committed Jul 10, 2024
1 parent 284f7a0 commit 84ef3f6
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build frontend

on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: npm ci

- name: Lint
run: npx --no-install next lint

- name: Format
run: npm run format

- name: Build with Next.js
run: npx --no-install next build

0 comments on commit 84ef3f6

Please sign in to comment.