Added actions workflow
This commit is contained in:
parent
e62029aaaf
commit
5b304f2b5f
28
.gitea/build-push.yml
Normal file
28
.gitea/build-push.yml
Normal file
@ -0,0 +1,28 @@
|
||||
name: Build and Push Docker Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Log in to Gitea Docker Registry
|
||||
run: echo "${{ secrets.GITEA_PAT }}" | docker login ${{ secrets.GITEA_SERVER }} -u ${{ secrets.GITEA_USER }} --password-stdin
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.GITEA_SERVER }}/${{ env.GITEA_USER }}/${{ env.GITEA_REPO }}:${{ env.IMAGE_TAG }}
|
||||
|
||||
- name: Log out from Gitea Docker Registry
|
||||
run: docker logout ${{ env.GITEA_SERVER }}
|
23
build-push.sh
Executable file
23
build-push.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load environment variables from .env file
|
||||
if [ -f .env ]; then
|
||||
export $(grep -v '^#' .env | xargs)
|
||||
else
|
||||
echo "Error: .env file not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure Docker is logged in using non-interactive mode
|
||||
echo "$GITEA_PAT" | docker login $GITEA_SERVER -u $GITEA_USER --password-stdin
|
||||
|
||||
# Build and tag the Docker image
|
||||
docker build -t $GITEA_SERVER/$GITEA_USER/$GITEA_REPO:$IMAGE_TAG .
|
||||
|
||||
# Push the image
|
||||
DOCKER_CLI_EXPERIMENTAL=enabled docker --log-level debug push $GITEA_SERVER/$GITEA_USER/$GITEA_REPO:$IMAGE_TAG
|
||||
|
||||
# Logout to prevent credential storage
|
||||
docker logout $GITEA_SERVER
|
||||
|
||||
echo "Docker image pushed successfully!"
|
@ -12,10 +12,12 @@ export async function generateStaticParams() {
|
||||
|
||||
export default async function BlogPage() {
|
||||
const postFolders = fs.readdirSync(postsDirectory);
|
||||
const posts = postFolders.map((slug) => {
|
||||
const { title, description } = require(`./posts/${slug}/page.tsx`);
|
||||
return { slug, title, description };
|
||||
});
|
||||
const posts = await Promise.all(
|
||||
postFolders.map(async (slug) => {
|
||||
const { title, description } = await import(`./posts/${slug}/metadata.ts`);
|
||||
return { slug, title, description };
|
||||
})
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
2
src/app/blog/posts/example/metadata.ts
Normal file
2
src/app/blog/posts/example/metadata.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export const title = "Example Blog Post";
|
||||
export const description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
@ -1,13 +1,16 @@
|
||||
// /blog/posts/example/page.tsx
|
||||
export const title = "Example Blog Post";
|
||||
export const description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
||||
import Head from 'next/head';
|
||||
import { title, description } from './metadata';
|
||||
|
||||
export default function ExamplePost() {
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
</Head>
|
||||
<h1>{title}</h1>
|
||||
<p>{description}</p>
|
||||
<p>Here is the full content of the blog post.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
2
src/app/blog/posts/example2/metadata.ts
Normal file
2
src/app/blog/posts/example2/metadata.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export const title = "Example Blog Post 2";
|
||||
export const description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
@ -1,13 +1,16 @@
|
||||
// /blog/posts/example/page.tsx
|
||||
export const title = "Example Blog Post 2";
|
||||
export const description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
||||
import Head from 'next/head';
|
||||
import { title, description } from './metadata';
|
||||
|
||||
export default function ExamplePost() {
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
</Head>
|
||||
<h1>{title}</h1>
|
||||
<p>{description}</p>
|
||||
<p>Here is the full content of the blog post.</p>
|
||||
<p>Here is the full content of the blog post. #2</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
@ -5,7 +5,8 @@ import Head from "next/head";
|
||||
|
||||
const open_sans = Open_Sans({
|
||||
weight: '500',
|
||||
display: 'swap'
|
||||
display: 'swap',
|
||||
subsets: ["latin"]
|
||||
})
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { LuExternalLink } from "react-icons/lu";
|
||||
|
||||
@ -8,10 +7,10 @@ export default function Home() {
|
||||
<div className="flex flex-row items-center justify-center pt-[100] md:w-[60%] xl:w-[40%] w-[85%] mx-auto">
|
||||
<div>
|
||||
<span className="text-ashgray text-2xl">
|
||||
Hi, I'm Asher 👋
|
||||
Hi, I'm Asher 👋
|
||||
</span>
|
||||
<p>
|
||||
I'm a Year 12 student passionate about software engineering and problem-solving. Studying Economics, Computing, Maths, and Chemistry, I enjoy coding, tackling challenges, and building practical solutions.
|
||||
I'm a Year 12 student passionate about software engineering and problem-solving. Studying Economics, Computing, Maths, and Chemistry, I enjoy coding, tackling challenges, and building practical solutions.
|
||||
|
||||
This site is where I share my projects, ideas, and experiences.
|
||||
</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user