Skip to content

Commit

Permalink
Deploy to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ckoates committed Aug 5, 2024
1 parent adba097 commit 53e590e
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 5 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: publish-to-github-pages
on:
push:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
cache-and-install:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm 📦
with:
version: 8
run_install: false

- name: Install Node.js 🚀
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies 📥
run: pnpm install

build:
runs-on: ubuntu-latest
needs: cache-and-install

steps:
- name: Setup Pages ⚙️
uses: actions/configure-pages@v4
with:
static_site_generator: next

- name: Build with Next.js 🏗️
run: pnpm run build

- name: Upload artifact 📡
uses: actions/upload-pages-artifact@v3
with:
path: ./out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
needs: build

steps:
- name: Publish to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const metadata: Metadata = {
card: "summary_large_image",
site: "@getRubyApp",
},
metadataBase: new URL("https://rubyapp.co"),
};

export default function RootLayout({
Expand Down
8 changes: 7 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { withContentCollections } from "@content-collections/next";
import withExportImages from "next-export-optimize-images";

export default withContentCollections();
export default async function config() {
const config = await withExportImages({
output: "export",
});
return withContentCollections(config);
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"build": "next build && next-export-optimize-images",
"start": "next start",
"lint": "next lint"
},
Expand All @@ -23,6 +23,7 @@
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"next-export-optimize-images": "^4.5.0",
"postcss": "^8",
"tailwindcss": "^3.4.7",
"typescript": "^5"
Expand Down
Loading

0 comments on commit 53e590e

Please sign in to comment.