Skip to content

Commit 5534ed0

Browse files
author
ESaracay
committed
Added workflow for launching application to github pages
1 parent ec757ec commit 5534ed0

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

.github/workflows/publish.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# File: .github/workflows/publish.yml
2+
name: publish-to-github-pages
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout 🛎️
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
26+
uses: ./.github/workflows/setup-node
27+
28+
- name: Setup Pages ⚙️
29+
uses: actions/configure-pages@v4
30+
with:
31+
static_site_generator: next
32+
33+
- name: Build with Next.js 🏗️
34+
run: npx next build
35+
36+
- name: Upload artifact 📡
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: ./out
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
46+
runs-on: ubuntu-latest
47+
needs: build
48+
49+
steps:
50+
- name: Publish to GitHub Pages 🚀
51+
id: deployment
52+
uses: actions/deploy-pages@v4
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# File: .github/workflows/setup-node/action.yml
2+
name: setup-node
3+
description: "Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧"
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Setup Node.js ⚙️
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version: 20
11+
12+
- name: Cache dependencies ⚡
13+
id: cache_dependencies
14+
uses: actions/cache@v3
15+
with:
16+
path: node_modules
17+
key: node-modules-${{ hashFiles('package-lock.json') }}
18+
19+
- name: Install dependencies 🔧
20+
shell: bash
21+
if: steps.cache_dependencies.outputs.cache-hit != 'true'
22+
run: npm ci

next.config.mjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {
3+
basePath: "/SoftwareGuide",
4+
output: "export",
5+
reactStrictMode: true,
6+
};
37

48
export default nextConfig;

0 commit comments

Comments
 (0)