Skip to content

Commit

Permalink
deploy website to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
munyanezaarmel committed Nov 12, 2024
1 parent d08919c commit a0869cb
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 15 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/check-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Deploy Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check-build:
name: Check dsh-website build
runs-on: ubuntu-latest
defaults:
run:
working-directory: dsh-website
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: npm

- name: Install Dependencies
run: npm ci

- name: Test Build Next.js Project
run: npm run build
64 changes: 64 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
name: Deploy GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: dsh-website
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: npm
cache-dependency-path: dsh-website/package-lock.json

- name: Install Dependencies
run: npm ci

- name: Build Next.js Project
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: dsh-website/out

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
16 changes: 8 additions & 8 deletions dsh-website/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import type { Metadata } from "next"
import localFont from "next/font/local"
import "./globals.css"

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
})
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});
})

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
}

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
children: React.ReactNode
}>) {
return (
<html lang="en">
Expand All @@ -31,5 +31,5 @@ export default function RootLayout({
{children}
</body>
</html>
);
)
}
6 changes: 3 additions & 3 deletions dsh-website/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextConfig } from "next";
import type { NextConfig } from "next"

const nextConfig: NextConfig = {
/* config options here */
};
}

export default nextConfig;
export default nextConfig
4 changes: 2 additions & 2 deletions dsh-website/postcss.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const config = {
plugins: {
tailwindcss: {},
},
};
}

export default config;
export default config
4 changes: 2 additions & 2 deletions dsh-website/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Config } from "tailwindcss";
import type { Config } from "tailwindcss"

export default {
content: [
Expand All @@ -15,4 +15,4 @@ export default {
},
},
plugins: [],
} satisfies Config;
} satisfies Config

0 comments on commit a0869cb

Please sign in to comment.