-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Deploy Nextra App to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger on pushes to the main branch | ||
pull_request: | ||
branches: | ||
- main # Trigger on PRs targeting the main branch | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Node.js | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" # Use the Node.js version that works with your project | ||
cache: "npm" | ||
|
||
# Step 3: Install dependencies inside the docs directory | ||
- name: Install dependencies | ||
run: | | ||
cd docs | ||
npm install | ||
# Step 4: Build the project inside the docs directory | ||
- name: Build project | ||
run: | | ||
cd docs | ||
npm run build | ||
# Step 5: Export the project to static files | ||
- name: Export to static files | ||
run: | | ||
cd docs | ||
npm run export | ||
# Step 6: Deploy to GitHub Pages | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/out # The export output will be in docs/out | ||
publish_branch: gh-pages # The branch to deploy to, typically 'gh-pages' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
const withNextra = require('nextra')({ | ||
theme: 'nextra-theme-docs', | ||
themeConfig: './theme.config.tsx', | ||
}) | ||
const withNextra = require("nextra")({ | ||
theme: "nextra-theme-docs", | ||
themeConfig: "./theme.config.tsx", | ||
}); | ||
|
||
module.exports = withNextra() | ||
module.exports = withNextra({ | ||
basePath: "/custom-hooks", | ||
assetPrefix: "/custom-hooks", | ||
images: { | ||
unoptimized: true, // Necessary for GitHub Pages | ||
}, | ||
}); |