-
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.
Merge branch 'master' of https://github.com/lucasdale99/portfolio
- Loading branch information
Showing
24 changed files
with
177 additions
and
187 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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Stage Deploy via SST | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Cache Next.js Build | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
.next/ | ||
.open-next/ | ||
.sst/ | ||
key: cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]xs') }} | ||
restore-keys: | | ||
cache-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Install AWS Creds | ||
run: | | ||
mkdir -p ~/.aws | ||
echo "[default]" > ~/.aws/credentials | ||
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials | ||
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials | ||
- name: Set SST Config Secret | ||
run: | | ||
npx sst secret set DATABASE_URL ${{ secrets.DATABASE_URL_STAGING }} --stage staging | ||
npx sst secret set NEXT_PUBLIC_URL ${{ secrets.NEXT_PUBLIC_URL_STAGING }} --stage staging | ||
npx sst secret set COMMIT_SHA ${{ github.sha }} --stage staging | ||
- name: Deploy with SST | ||
run: pnpm run deploy:staging | ||
|
||
- name: Clean up AWS Profile | ||
run: rm -rf ~/.aws |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use server"; | ||
|
||
import { eq } from "drizzle-orm"; | ||
import { db } from "@/lib/db"; | ||
import { blogsTable } from "@/lib/schema"; | ||
|
||
export async function getBlog(slug: string) { | ||
try { | ||
const incomingSlug = slug.replace(/^\/+|\/+$/g, ""); | ||
|
||
const blogData = await db | ||
.select() | ||
.from(blogsTable) | ||
.where(eq(blogsTable.slug, `/${incomingSlug}`)); | ||
|
||
if (!blogData.length) { | ||
throw new Error("Blog not found"); | ||
} | ||
|
||
return blogData[0]; | ||
} catch (error) { | ||
console.error("Error fetching blog:", error); | ||
throw new Error("Failed to fetch blog"); | ||
} | ||
} |
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,13 @@ | ||
"use server"; | ||
import { db } from "@/lib/db"; | ||
import { blogsTable } from "@/lib/schema"; | ||
|
||
export async function getBlogs() { | ||
try { | ||
const blogs = await db.select().from(blogsTable).execute(); | ||
return blogs; | ||
} catch (error) { | ||
console.error("Error fetching blogs:", error); | ||
throw new Error("Failed to fetch blogs"); | ||
} | ||
} |
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,18 @@ | ||
"use server"; | ||
|
||
import { db } from "../../lib/db"; | ||
import { workExperienceTable } from "../../lib/schema"; | ||
|
||
export async function getWorkExperience() { | ||
try { | ||
const workExperience = await db | ||
.select() | ||
.from(workExperienceTable) | ||
.orderBy(workExperienceTable.startDate); | ||
|
||
return workExperience; | ||
} catch (error) { | ||
console.error("Error fetching work experience:", error); | ||
throw new Error("Failed to fetch work experience"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.