This commit is contained in:
44
.gitea/workflows/deploy.yml
Normal file
44
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
name: Deploy Homepage
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Install
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
# build/standalone is the output directory for the Next.js app
|
||||||
|
# now we want to deploy a container with the built app
|
||||||
|
- name: Build Docker image
|
||||||
|
run: docker build -t homepage:latest -f Dockerfile.build .
|
||||||
|
- name: Stop and remove existing container
|
||||||
|
run: |
|
||||||
|
docker stop website-server || true
|
||||||
|
docker rm website-server || true
|
||||||
|
- name: Run Docker container
|
||||||
|
run: |
|
||||||
|
docker run -d \
|
||||||
|
--expose=80 \
|
||||||
|
--network=web \
|
||||||
|
--name website-server \
|
||||||
|
homepage:latest
|
||||||
|
- name: Clean up Docker image
|
||||||
|
run: docker rmi homepage:latest || true
|
||||||
|
- name: Clean up unused Docker resources
|
||||||
|
run: docker system prune -f --volumes || true
|
||||||
|
- name: Notify deployment success
|
||||||
|
run: echo "Deployment successful!"
|
||||||
|
|
@@ -2,6 +2,8 @@ import type { NextConfig } from "next";
|
|||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
/* config options here */
|
||||||
|
output: "standalone",
|
||||||
|
distDir: "build",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"esnext"
|
||||||
|
],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
@@ -19,9 +23,19 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": [
|
||||||
|
"./src/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
"include": [
|
||||||
"exclude": ["node_modules"]
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
".next/types/**/*.ts",
|
||||||
|
"next-env.d.ts",
|
||||||
|
"build/types/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user