forked from cruip/tailwind-landing-page-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
8 changed files
with
119 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and Deploy to Bunny.net | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
|
||
- name: Make lock file | ||
run: npm i --package-lock-only | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build application | ||
run: npm run build | ||
|
||
- name: Deploy to Bunny.net via FTP | ||
uses: SamKirkland/[email protected] | ||
with: | ||
server: ${{ secrets.FTP_HOSTNAME }} | ||
username: ${{ secrets.FTP_USERNAME }} | ||
password: ${{ secrets.FTP_PASSWORD }} | ||
local-dir: "./dist/" | ||
server-dir: "/" |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3' | ||
services: | ||
app: | ||
build: . | ||
ports: | ||
- "3002:80" | ||
environment: | ||
- NODE_ENV=production |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Use the official Node.js image as the base image for building | ||
FROM node:lts-slim AS build | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy the package.json and package-lock.json files to the working directory | ||
COPY package.json ./ | ||
RUN npm i --package-lock-only | ||
|
||
# Install the project dependencies | ||
RUN npm ci | ||
|
||
# Copy the rest of the project files to the working directory | ||
COPY . . | ||
|
||
# Build the Next.js application and export it as static files | ||
RUN npm run build | ||
|
||
# Use the official Nginx image as the base image for serving | ||
FROM nginx:stable-alpine | ||
|
||
# Copy the built files from the previous stage to the nginx html directory | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
# Copy the nginx configuration file | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Forward Nginx logs to Docker's stdout and stderr | ||
RUN ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log | ||
|
||
# Expose the port on which the application will run | ||
EXPOSE 80 | ||
|
||
# Start the Nginx server | ||
CMD ["nginx", "-g", "daemon off;"] |
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
output: "export", | ||
images: { | ||
unoptimized: true, | ||
}, | ||
distDir: "dist", | ||
}; | ||
|
||
module.exports = nextConfig; |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
} | ||
} |