Skip to content

Commit 1225857

Browse files
authored
Create nextjs.yml
1 parent ba8ff72 commit 1225857

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Sample workflow for building and deploying a Next.js site to GitHub Pages
2+
#
3+
# To get started with Next.js see: https://nextjs.org/docs/getting-started
4+
#
5+
name: Deploy Brno Pizza to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: ["main"]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Add Bun
35+
uses: oven-sh/setup-bun@v2
36+
# - name: Setup Node
37+
# uses: actions/setup-node@v4
38+
# with:
39+
# node-version: "20"
40+
# cache: ${{ steps.detect-package-manager.outputs.manager }}
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v5
43+
with:
44+
# Automatically inject basePath in your Next.js configuration file and disable
45+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
46+
#
47+
# You may remove this line if you want to manage the configuration yourself.
48+
static_site_generator: next
49+
- name: Restore cache
50+
uses: actions/cache@v4
51+
with:
52+
path: |
53+
.next/cache
54+
# Generate a new cache whenever packages or source files change.
55+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
56+
# If source files changed but packages didn't, rebuild from a prior cache.
57+
restore-keys: |
58+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
59+
- name: Install dependencies
60+
run: bun install
61+
- name: Build with Next.js
62+
run: bun run build
63+
- name: Upload artifact
64+
uses: actions/upload-pages-artifact@v3
65+
with:
66+
path: ./out
67+
68+
# Deployment job
69+
deploy:
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
runs-on: ubuntu-latest
74+
needs: build
75+
steps:
76+
- name: Deploy to GitHub Pages
77+
id: deployment
78+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)