Skip to content

Latest commit

 

History

History
executable file
·
84 lines (64 loc) · 1.71 KB

README.md

File metadata and controls

executable file
·
84 lines (64 loc) · 1.71 KB

NextJS App Example

This example demonstrates how to publish your NextJS App on Valist.

Click here to view this project on Valist.

Setup

Edit your package.json to build a static version of your site.

{
  "scripts": {
    "build": "next build && next export"
  }
}

Edit your next.config.js to use relative asset paths.

const nextConfig = {
  assetPrefix: './',
}

Publish with the Valist GitHub Action

See the GitHub Action Quick Start for more info.

on:
  release:
    types: [published]
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
      - uses: actions/checkout@v2
      - run: |
          npm install
          npm run build
      - uses: valist-io/[email protected]
        with:
          private-key: ${{ secrets.PRIVATE_KEY }}
          account: <your-account-name-here>
          project: <your-project-name-here>
          release: ${{ github.ref_name }}
          path: './out'

Publish with the Valist CLI

See the CLI Quick Start for more info.

Simple

Run the following from your project root.

$ npm run build
$ valist publish <your-account-name-here>/<your-project-name-here>/<your-release-name-here> ./out

Advanced

Create a valist.yml file in your project root.

account: <your-account-name-here>
project: <your-project-name-here>
release: <your-release-name-here>
path: ./out

Run the following from your project root.

$ npm run build
$ valist publish