You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To actually get an out/ directory I had to set output: 'export', however that gave me some error about images. I solved that by setting image.unoptimized: true (however I wish there was a better experience out of the box).
Then I could create a GitHub Action called .github/worflows/gh-pages.yml:
name: Deploy Github Pageson:
push:
branches:
- mainjobs:
deploy-github-pages:
runs-on: ubuntu-latest# Grant GITHUB_TOKEN the permissions required to make a Pages deploymentpermissions:
pages: write # to deploy to Pagesid-token: write # to verify the deployment originates from an appropriate source# Deploy to the github-pages environmentenvironment:
name: github-pagesurl: ${{ steps.deployment.outputs.page_url }}steps:
- name: 'Checking Out Code'uses: actions/checkout@v3with:
fetch-depth: 0
- name: 'Setting up Node'uses: actions/setup-node@v4with:
node-version: 20
- uses: pnpm/action-setup@v2with:
version: 8
- name: 'Setup & Build'run: | cd docs/ pnpm install pnpm build
- name: 'upload'uses: actions/upload-pages-artifact@v3with:
path: ./docs/out
- name: Deploy to GitHub Pagesid: deploymentuses: actions/deploy-pages@v4
Seems like it could save people some time if this was documented.
The text was updated successfully, but these errors were encountered:
Would be nice with some instructions for how to deploy Nextra to GitHub Pages (while using GitHub Actions).
Personally I had to use the following
next.config.js
:To actually get an
out/
directory I had to setoutput: 'export'
, however that gave me some error about images. I solved that by settingimage.unoptimized: true
(however I wish there was a better experience out of the box).Then I could create a GitHub Action called
.github/worflows/gh-pages.yml
:Seems like it could save people some time if this was documented.
The text was updated successfully, but these errors were encountered: