mirror of
https://github.com/Kizuren/kizuren.dev.git
synced 2025-12-21 21:16:12 +01:00
Reversed to node
This commit is contained in:
parent
edc5386c6d
commit
e39b4f4d58
7 changed files with 17543 additions and 4063 deletions
131
.github/workflows/build.yml
vendored
131
.github/workflows/build.yml
vendored
|
|
@ -2,109 +2,44 @@ name: Build Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
#release:
|
||||||
types: [created]
|
# types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Update lockfile for Dependabot PRs
|
|
||||||
update-lockfile:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'dependabot/')
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{ github.head_ref }}
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- name: Install and update lockfile
|
|
||||||
run: bun install
|
|
||||||
- name: Commit and push updated lockfile
|
|
||||||
run: |
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add bun.lock
|
|
||||||
git commit -m "chore: update lockfile (auto-fix for Dependabot PR)" || exit 0
|
|
||||||
git push
|
|
||||||
|
|
||||||
# Build and don't push Docker image for Dependabot PRs
|
|
||||||
build_dependabot:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: update-lockfile
|
|
||||||
if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'dependabot/')
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{ github.head_ref }}
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Set image metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ghcr.io/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=tag
|
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
|
||||||
type=sha,format=short
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: false
|
|
||||||
platforms: linux/amd64,linux/arm64/v8
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'dependabot/'))
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
- name: Set up Docker Buildx
|
||||||
- name: Login to GitHub Container Registry
|
uses: docker/setup-buildx-action@v3
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
- name: Login to GitHub Container Registry
|
||||||
registry: ghcr.io
|
uses: docker/login-action@v3
|
||||||
username: ${{ github.actor }}
|
with:
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
registry: ghcr.io
|
||||||
- name: Set image metadata
|
username: ${{ github.actor }}
|
||||||
id: meta
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
- name: Docker meta
|
||||||
images: ghcr.io/${{ github.repository }}
|
id: meta
|
||||||
tags: |
|
uses: docker/metadata-action@v5
|
||||||
type=ref,event=tag
|
with:
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
images: ghcr.io/${{ github.repository }}
|
||||||
type=sha,format=short
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=tag
|
||||||
type=ref,event=pr
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v6
|
- name: Build and push Docker image
|
||||||
with:
|
uses: docker/build-push-action@v6
|
||||||
context: .
|
with:
|
||||||
file: ./Dockerfile
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64/v8
|
platforms: linux/amd64
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
22
Dockerfile
22
Dockerfile
|
|
@ -1,23 +1,15 @@
|
||||||
FROM oven/bun:1 AS builder
|
FROM node:22-alpine AS build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json bun.lock ./
|
COPY package*.json ./
|
||||||
RUN bun install --frozen-lockfile
|
RUN npm ci
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
RUN bun run build
|
FROM node:22-alpine
|
||||||
|
|
||||||
FROM oven/bun:1-slim AS runner
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/.output /app/.output
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
|
|
||||||
COPY --from=builder /app/.output /app/.output
|
|
||||||
COPY --from=builder /app/package.json ./
|
|
||||||
COPY --from=builder /app/bun.lock ./
|
|
||||||
|
|
||||||
RUN bun install
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
CMD ["node", ".output/server/index.mjs"]
|
||||||
CMD ["bun", ".output/server/index.mjs"]
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
services:
|
|
||||||
kizuren:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: kizuren
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "9031:3000"
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
volumes:
|
|
||||||
- ./logs:/app/logs
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
services:
|
services:
|
||||||
kizuren:
|
kizurendev:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
image: ghcr.io/kizuren/kizuren.dev
|
image: ghcr.io/kizuren/kizuren.dev
|
||||||
container_name: kizuren
|
container_name: kizurendev
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "9031:3000"
|
- "9031:3000"
|
||||||
|
|
|
||||||
17493
package-lock.json
generated
Normal file
17493
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -13,7 +13,7 @@
|
||||||
"@nuxt/content": "^3.6.3",
|
"@nuxt/content": "^3.6.3",
|
||||||
"@nuxt/eslint": "^1.9.0",
|
"@nuxt/eslint": "^1.9.0",
|
||||||
"@nuxt/fonts": "^0.11.4",
|
"@nuxt/fonts": "^0.11.4",
|
||||||
"@nuxt/icon": "^1.15.0",
|
"@nuxt/icon": "^2.0.0",
|
||||||
"@nuxt/image": "^1.11.0",
|
"@nuxt/image": "^1.11.0",
|
||||||
"@nuxt/scripts": "^0.11.13",
|
"@nuxt/scripts": "^0.11.13",
|
||||||
"@nuxt/test-utils": "^3.19.2",
|
"@nuxt/test-utils": "^3.19.2",
|
||||||
|
|
@ -22,18 +22,19 @@
|
||||||
"@tailwindcss/vite": "^4.1.12",
|
"@tailwindcss/vite": "^4.1.12",
|
||||||
"@unhead/vue": "^2.0.14",
|
"@unhead/vue": "^2.0.14",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
|
"better-sqlite3": "^12.2.0",
|
||||||
"eslint": "^9.34.0",
|
"eslint": "^9.34.0",
|
||||||
"nuxt": "^3.18.1",
|
"nuxt": "^4.0.3",
|
||||||
"sass": "^1.91.0",
|
"sass": "^1.91.0",
|
||||||
"tailwindcss": "^4.1.12",
|
"tailwindcss": "^4.1.12",
|
||||||
"typescript": "^5.9.2",
|
"typescript": "^5.9.2",
|
||||||
"vue": "^3.5.20",
|
"vue": "^3.5.21",
|
||||||
"vue-router": "^4.5.1"
|
"vue-router": "^4.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify-json/material-symbols": "^1.2.33",
|
"@iconify-json/material-symbols": "^1.2.33",
|
||||||
"@iconify-json/simple-icons": "^1.2.50",
|
"@iconify-json/simple-icons": "^1.2.50",
|
||||||
"@nuxtjs/mdc": "^0.16.1",
|
"@nuxtjs/mdc": "^0.17.3",
|
||||||
"@tailwindcss/typography": "^0.5.16"
|
"@tailwindcss/typography": "^0.5.16"
|
||||||
},
|
},
|
||||||
"trustedDependencies": [
|
"trustedDependencies": [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue