The Fleek Next.js adapter allows you to deploy your server-side Next.js application on Fleek.
This repository is currently under development and is a Work in Progress. Features and functionalities may change frequently.
- npm
npm install @fleek-platform/next
- pnpm
pnpm install @fleek-platform/next
To deploy your Next.js application to Fleek, follow these steps:
- Configure Edge Runtime Add the following code to any routes that run server-side code to ensure they run on the edge:
export const runtime = 'edge';
- Set environment variables
export FLEEK_TOKEN=<your personal access token>
- Add
fleek.json
to your project's root dir:
{
"FLEEK_PROJECT_ID": "<your project id>"
}
- Build and Deploy
Use the Fleek Next.js adapter to build and deploy your application via the command line:
npx fleek-next deploy
# or if installed globally
fleek-next deploy
If you are running the command outside of your project's root dir, you can set the path to it with the project path flag -p
/--projectPath
:
fleek-next deploy -p path/to/my/repo
If you don't have a project ID or Fleek personal access token, you can make use of the Fleek CLI:
- Install the Fleek CLI
npm i -g @fleek-platform/cli
- Login to your Fleek account
fleek login
- Create a personal access token and store it somewhere safe:
fleek pat create --name '<name of your personal access token>'
- Create a project if you don't have one yet:
fleek projects create --name '<name of your project>'
- Get your project ID:
fleek projects list | grep '<name of your project>' | awk '{print $1}'
The deploy
command supports several options to customize the build and deployment process:
-d, --dryrun
: Builds the Next.js app without deploying it to Fleek. Defaults tofalse
.-p, --project-path <path>
: The path to your Next.js project's root directory. Defaults to the path where the command is run.-s, --skipBuild
: Skip building the Next.js app before deployment, useful if you want to build the application yourself due to any possible extra steps. Defaults tofalse
.-c, --clean
: Clean previous build artifacts before building.-v, --verbose
: Enable verbose logging.
This project follows SemVer for versioning. Here's how to release a new version:
- Update Version Number: Bump the version number in package.json using npm version (patch/minor/major). This will update the version number in package.json and create a new Git tag.
pnpm version patch
- Push Changes and Tags
git push origin main --follow-tags
- GitHub Actions Automation: A GitHub Actions workflow automatically publishes the package to npm when a new tag is pushed.
Thanks for considering contributing to our project!
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch-name
. - Make your changes.
- Commit your changes using conventional commits.
- Push to your fork and submit a pull request.
We use Conventional Commits for our commit messages:
test
: 💍 Adding missing testsfeat
: 🎸 A new featurefix
: 🐛 A bug fixchore
: 🤖 Build process or auxiliary tool changesdocs
: ✏️ Documentation only changesrefactor
: 💡 A code change that neither fixes a bug or adds a featurestyle
: 💄 Markup, white-space, formatting, missing semi-colons...