Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rodion-arr authored Sep 8, 2023
1 parent c682e20 commit 2c3d9e0
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Build"

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

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: npm
cache-dependency-path: package-lock.json
- name: Restore cache
uses: actions/cache@v3
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: Test
run: npm t
- name: Build with Next.js
run: npx next build

0 comments on commit 2c3d9e0

Please sign in to comment.