fix DockerFile
All checks were successful
Deploy Nuxt App / deploy (push) Successful in 2m39s

This commit is contained in:
levis
2025-06-19 16:59:26 +00:00
parent 551f68a78a
commit 76aa42dc25
5 changed files with 33 additions and 23 deletions

View File

@ -1,4 +1,4 @@
name: Deploy Application
name: Deploy Nuxt App
on: [push]
jobs:
@ -8,27 +8,37 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
token: 0406afe7de6547e850dd62c84976c6def23a5193
token: ${{ secrets.TOKEN }}
- name: Install curl
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies and build
run: |
if command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y curl
elif command -v apk &> /dev/null; then
apk add --no-cache curl
elif command -v yum &> /dev/null; then
yum install -y curl
fi
npm install
npm run build
- name: Upload config files to server
- name: Prepare deployment files
run: |
tar -czf deploy.tar.gz dist Dockerfile docker-compose.yml
- name: Upload files via Gitea API
env:
GITEA_API: "https://gitea.miduway.space/api/v1/repos/levis/ebook/raw/main"
GITEA_TOKEN: "0406afe7de6547e850dd62c84976c6def23a5193"
GITEA_API: "https://gitea.miduway.space/api/v1/repos/levis/ebook/raw/production"
GITEA_TOKEN: ${{ secrets.TOKEN }}
run: |
for file in docker-compose.yml Dockerfile; do
echo "Uploading $file"
for file in Dockerfile docker-compose.yml; do
curl -X PUT \
-H "Authorization: token $GITEA_TOKEN" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: text/plain" \
-T "$file" \
"$GITEA_API/$file"
"$GITEA_API/$file?branch=main"
done
curl -X PUT \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/gzip" \
-T "deploy.tar.gz" \
"$GITEA_API/deploy.tar.gz?branch=main"

2
.nuxt/nuxt.d.ts vendored
View File

@ -1,9 +1,9 @@
/// <reference types="@nuxt/eslint" />
/// <reference types="@nuxt/icon" />
/// <reference types="@nuxt/image" />
/// <reference types="@pinia/nuxt" />
/// <reference types="@nuxtjs/tailwindcss" />
/// <reference types="@pinia/nuxt" />
/// <reference types="@pinia/nuxt" />
/// <reference types="@nuxt/devtools" />
/// <reference types="@nuxt/telemetry" />
/// <reference path="types/builder-env.d.ts" />

View File

@ -1,4 +1,4 @@
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 6/18/2025, 4:55:05 AM
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 6/19/2025, 4:53:06 PM
import "@nuxtjs/tailwindcss/config-ctx"
import configMerger from "@nuxtjs/tailwindcss/merger";

View File

@ -119,7 +119,7 @@
"./imports"
],
"#app-manifest": [
"./manifest/meta/e4f4ddb1-4c47-45da-a6d9-ad6f888061fb.json"
"./manifest/meta/f4dfbb73-66a7-4162-b534-4c8db9f3aa74.json"
],
"#components": [
"./components"

View File

@ -1,7 +1,7 @@
FROM node:18-alpine
FROM node:22-alpine
WORKDIR /usr/src/app
COPY package*..json ./
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["node", ".dist/server/index.mjs"]
CMD ["node", "dist/server/index.mjs"]