Change prod workflow and add automatic deployment
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
CAP_ENV=dev
|
||||
VITE_API_URL=https://zenkanji-api.crylia.de
|
||||
2
client/.gitignore
vendored
2
client/.gitignore
vendored
@@ -1,5 +1,3 @@
|
||||
node_modules
|
||||
.env
|
||||
.env.android
|
||||
my-release-key.jks
|
||||
gradle.properties
|
||||
|
||||
@@ -1,15 +1,31 @@
|
||||
FROM node:24-alpine AS dev-stage
|
||||
# Stage 1: Build the Application
|
||||
FROM node:20-alpine AS build-stage
|
||||
WORKDIR /app
|
||||
|
||||
ARG VITE_API_URL
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine AS dev-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
EXPOSE 5173
|
||||
CMD ["npm", "run", "dev", "--", "--host"]
|
||||
|
||||
FROM dev-stage AS build-stage
|
||||
ARG VITE_API_URL
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
RUN npm run build
|
||||
FROM nginx:alpine AS production-stage
|
||||
RUN mkdir -p /run/nginx
|
||||
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -16,12 +16,28 @@ android {
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
if (file("my-release-key.jks").exists()) {
|
||||
storeFile file("my-release-key.jks")
|
||||
storePassword RELEASE_KEY_PASSWORD
|
||||
keyAlias "my-key-alias"
|
||||
keyPassword RELEASE_KEY_PASSWORD
|
||||
if (project.hasProperty("RELEASE_KEY_PASSWORD")) {
|
||||
storePassword RELEASE_KEY_PASSWORD
|
||||
keyPassword RELEASE_KEY_PASSWORD
|
||||
} else if (System.getenv("RELEASE_KEY_PASSWORD") != null) {
|
||||
storePassword System.getenv("RELEASE_KEY_PASSWORD")
|
||||
keyPassword System.getenv("RELEASE_KEY_PASSWORD")
|
||||
} else {
|
||||
storePassword "missing_password"
|
||||
keyPassword "missing_password"
|
||||
}
|
||||
if (project.hasProperty("RELEASE_KEY_ALIAS")) {
|
||||
keyAlias RELEASE_KEY_ALIAS
|
||||
} else if (System.getenv("RELEASE_KEY_ALIAS") != null) {
|
||||
keyAlias System.getenv("RELEASE_KEY_ALIAS")
|
||||
} else {
|
||||
keyAlias "my-key-alias"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
2
client/android/gradle.properties
Normal file
2
client/android/gradle.properties
Normal file
@@ -0,0 +1,2 @@
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
android.useAndroidX=true
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<title>Zen Kanji</title>
|
||||
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
|
||||
<link rel="icon" type="image/x-icon" href="/src/assets/favicon.ico">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
16
client/nginx.conf
Normal file
16
client/nginx.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,33 @@
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueDevTools from 'vite-plugin-vue-devtools';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
vueDevTools(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
allowedHosts: [
|
||||
'zenkanji.crylia.de',
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
vue(),
|
||||
vueDevTools(),
|
||||
],
|
||||
host: true,
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
hmr: {
|
||||
host: 'zenkanji.crylia.de',
|
||||
protocol: 'wss',
|
||||
clientPort: 443,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
allowedHosts: [
|
||||
'localhost',
|
||||
],
|
||||
host: true,
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
hmr: {
|
||||
host: 'localhost',
|
||||
protocol: 'ws',
|
||||
clientPort: 5173,
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user