-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
- Loading branch information
1 parent
a973672
commit 3dfa2dd
Showing
5 changed files
with
110 additions
and
2 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,77 @@ | ||
name: 🚀 Deploy Next.js UI to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
# Allows only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, we do not cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
node_version: | ||
- 20 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: latest | ||
run_install: false | ||
|
||
- name: Get pnpm cache directory path | ||
id: pnpm-cache-dir-path | ||
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | ||
|
||
- name: Restore pnpm cache | ||
uses: actions/cache@v3 | ||
id: pnpm-cache | ||
with: | ||
path: ${{ steps.pnpm-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Use Node.js ${{ matrix.node_version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- name: Build with Next.js | ||
run: pnpm build:interface | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: ./out | ||
|
||
deploy: | ||
runs-on: ${{ matrix.os }} | ||
needs: build | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
pages: write | ||
id-token: write | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v3 |
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,32 @@ | ||
// @ts-check | ||
|
||
/** | ||
* @type {import('next').NextConfig} | ||
**/ | ||
const nextConfig = { | ||
/** | ||
* Enable static exports for the App Router. | ||
* | ||
* @see https://nextjs.org/docs/pages/building-your-application/deploying/static-exports | ||
*/ | ||
output: "export", | ||
|
||
/** | ||
* Set base path. This is usually the slug of your repository. | ||
* | ||
* @see https://nextjs.org/docs/app/api-reference/next-config-js/basePath | ||
*/ | ||
basePath: "/createx", | ||
|
||
/** | ||
* Disable server-based image optimization. Next.js does not support | ||
* dynamic features with static exports. | ||
* | ||
* @see https://nextjs.org/docs/pages/api-reference/components/image#unoptimized | ||
*/ | ||
images: { | ||
unoptimized: true, | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig; |
Empty file.
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
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