Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to main merge test action #25

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
128 changes: 128 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Next.js CI Pipeline

# Define triggers for each stage
on:
push:
branches:
- "**" # Lint and build on all branches
pull_request:
types:
- closed
env:
REGISTRY: docker.io

jobs:
# Linting Job
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

# Build Job
build:
name: Build Application
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Build the app
run: npm run build

# Audit and Docker Push Job (Runs only when a merge happens to the main branch)
audit_and_push:
name: Audit and Push Docker Image
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'Merge pull request')
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Run npm audit
run: npm audit --audit-level=high

# Install the cosign tool except on PR
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
with:
cosign-release: "v2.2.4"

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

# Login against a Docker registry except on PR
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ secrets.DOCKER_REPO }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Stage 1: Install dependencies and build the Next.js app
FROM node:18-alpine AS builder

WORKDIR /app

COPY package.json package-lock.json ./

# clean install based on package-lock.json
RUN npm ci

COPY . .

RUN npm run build

# Stage 2: Serve the app in production
FROM node:18-alpine AS runner

WORKDIR /app

COPY --from=builder /app ./

# Expose port 3000 for the Next.js app
EXPOSE 3000

# Set the environment to production
ENV NODE_ENV=production

# Start the Next.js app (using the built-in Next.js server)
CMD ["npm", "run", "start"]
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
# Startup - Free Next.js Startup Website Template

Adapt readme file!

Startup free, open-source, and premium-quality startup website template for Next.js comes with everything you need to launch a startup, business, or SaaS website, including all essential sections, components, and pages.

If you're looking for a high-quality and visually appealing, feature-rich Next.js Template for your next startup, SaaS, or business website, this is the perfect choice and starting point for you!

### ✨ Key Features

- Crafted for Startup and SaaS Business
- Next.js and Tailwind CSS
- All Essential Business Sections and Pages
- High-quality and Clean Design
- Dark and Light Version
- TypeScript Support
and Much More ...
and Much More ...

### 🙌 Detailed comparison between the Free and Pro versions of Startup

| Feature | Free | Pro |
|---------------------|------------|----------|
| Next.js Landing Page | ✅ Yes | ✅ Yes |
| All The Integrations - Auth, DB, Payments, Blog and many more ... | ❌ No | ✅ Yes |
| Homepage Variations | 1 | 2 |
| Additional SaaS Pages and Components | ❌ No | ✅ Yes |
| Functional Blog with Sanity | ❌ No | ✅ Yes | ✅ Yes |
| Use with Commercial Projects | ✅ Yes | ✅ Yes |
| Lifetime Free Updates | ✅ Yes | ✅ Yes |
| Email Support | ❌ No | ✅ Yes |
| Community Support | ✅ Yes | ✅ Yes |

| Feature | Free | Pro |
| ----------------------------------------------------------------- | ------ | ------ | ------ |
| Next.js Landing Page | ✅ Yes | ✅ Yes |
| All The Integrations - Auth, DB, Payments, Blog and many more ... | ❌ No | ✅ Yes |
| Homepage Variations | 1 | 2 |
| Additional SaaS Pages and Components | ❌ No | ✅ Yes |
| Functional Blog with Sanity | ❌ No | ✅ Yes | ✅ Yes |
| Use with Commercial Projects | ✅ Yes | ✅ Yes |
| Lifetime Free Updates | ✅ Yes | ✅ Yes |
| Email Support | ❌ No | ✅ Yes |
| Community Support | ✅ Yes | ✅ Yes |

### [🔥 Get Startup Pro](https://nextjstemplates.com/templates/saas-starter-startup)

[![Startup Pro](https://raw.githubusercontent.com/NextJSTemplates/startup-nextjs/main/startup-pro.webp)](https://nextjstemplates.com/templates/saas-starter-startup)

Startup Pro - Expertly crafted for fully-functional, high-performing SaaS startup websites. Comes with with Authentication, Database, Blog, and all the essential integrations necessary for SaaS business sites.


### [🚀 View Free Demo](https://startup.nextjstemplates.com/)

### [🚀 View Pro Demo](https://startup-pro.nextjstemplates.com/)
Expand All @@ -51,11 +52,12 @@ Startup Pro - Expertly crafted for fully-functional, high-performing SaaS startu

[![Deploy with Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/NextJSTemplates/startup-nextjs)


### 📄 License

Startup is 100% free and open-source, feel free to use with your personal and commercial projects.

### 💜 Support

If you like the template, please star this repository to inspire the team to create more stuff like this and reach more users like you!

### ✨ Explore and Download - Free [Next.js Templates](https://nextjstemplates.com)
Loading