npm i -D gh-pages {
"name": "reparability-landing",
"homepage": "https://nicolashedoire.github.io/reparability-landing"
} "scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"export": "next build && next export",
},name: Github-page-deploy
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: checkout
uses: actions/checkout@v2
- name: use Node version ${{matrix.node-version}}
uses: actions/setup-node@v2.1.5
with:
node-version: ${{matrix.node-version}}
- run: npm i
- run: npm run build --if-present
env:
NEXT_PUBLIC_BASE_PATH: '/next-js-reparability-landing'
- run: npm run export
env:
NEXT_PUBLIC_BASE_PATH: '/next-js-reparability-landing'
- run: touch './out/.nojekyll'
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: out # The folder the action should deploy.
module.exports = {
images: {
loader: "imgix",
path: "",
},
basePath: process.env.NEXT_PUBLIC_BASE_PATH ,
assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH
}Créer un fichier next.config.js