mirror of
https://github.com/Kizuren/kizuren.dev.git
synced 2025-12-21 13:06:11 +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:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [created]
|
||||
#release:
|
||||
# types: [created]
|
||||
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'dependabot/'))
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
- 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: ${{ github.event_name != 'pull_request' }}
|
||||
platforms: linux/amd64,linux/arm64/v8
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- 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: Docker meta
|
||||
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}}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
22
Dockerfile
22
Dockerfile
|
|
@ -1,23 +1,15 @@
|
|||
FROM oven/bun:1 AS builder
|
||||
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json bun.lock ./
|
||||
RUN bun install --frozen-lockfile
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
RUN bun run build
|
||||
|
||||
FROM oven/bun:1-slim AS runner
|
||||
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/.output /app/.output
|
||||
ENV NODE_ENV=production
|
||||
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
|
||||
|
||||
CMD ["bun", ".output/server/index.mjs"]
|
||||
CMD ["node", ".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:
|
||||
kizuren:
|
||||
kizurendev:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: ghcr.io/kizuren/kizuren.dev
|
||||
container_name: kizuren
|
||||
container_name: kizurendev
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "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/eslint": "^1.9.0",
|
||||
"@nuxt/fonts": "^0.11.4",
|
||||
"@nuxt/icon": "^1.15.0",
|
||||
"@nuxt/icon": "^2.0.0",
|
||||
"@nuxt/image": "^1.11.0",
|
||||
"@nuxt/scripts": "^0.11.13",
|
||||
"@nuxt/test-utils": "^3.19.2",
|
||||
|
|
@ -22,18 +22,19 @@
|
|||
"@tailwindcss/vite": "^4.1.12",
|
||||
"@unhead/vue": "^2.0.14",
|
||||
"animate.css": "^4.1.1",
|
||||
"better-sqlite3": "^12.2.0",
|
||||
"eslint": "^9.34.0",
|
||||
"nuxt": "^3.18.1",
|
||||
"nuxt": "^4.0.3",
|
||||
"sass": "^1.91.0",
|
||||
"tailwindcss": "^4.1.12",
|
||||
"typescript": "^5.9.2",
|
||||
"vue": "^3.5.20",
|
||||
"vue": "^3.5.21",
|
||||
"vue-router": "^4.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/material-symbols": "^1.2.33",
|
||||
"@iconify-json/simple-icons": "^1.2.50",
|
||||
"@nuxtjs/mdc": "^0.16.1",
|
||||
"@nuxtjs/mdc": "^0.17.3",
|
||||
"@tailwindcss/typography": "^0.5.16"
|
||||
},
|
||||
"trustedDependencies": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue