Skip to content

Commit f4491cb

Browse files
committed
Fixed buidling
1 parent 7c4f10c commit f4491cb

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

.github/workflows/ftp-deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [closed]
9+
branches:
10+
- main
11+
12+
jobs:
13+
deploy:
14+
if: github.event.pull_request.merged == true || github.event_name == 'push'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Deploy to FTP
21+
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
22+
with:
23+
server: ${{ secrets.FTP_SERVER }}
24+
username: ${{ secrets.FTP_USERNAME }}
25+
password: ${{ secrets.FTP_PASSWORD }}
26+
local-dir: ./dist/
27+
server-dir: /
28+
dangerous-clean-slate: true
29+
exclude: |
30+
.ftpquota

dist/.htaccess

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine On
3+
RewriteBase /
4+
RewriteRule ^index\.html$ - [L]
5+
RewriteCond %{REQUEST_FILENAME} !-f
6+
RewriteCond %{REQUEST_FILENAME} !-d
7+
RewriteRule . /index.html [L]
8+
</IfModule>
9+
10+
# php -- BEGIN cPanel-generated handler, do not edit
11+
# Set the “ea-php74” package as the default “PHP” programming language.
12+
<IfModule mime_module>
13+
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
14+
</IfModule>
15+
# php -- END cPanel-generated handler, do not edit

vite.config.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,34 @@ import { defineConfig } from "vite";
22
import vue from "@vitejs/plugin-vue";
33
import vueJsx from "@vitejs/plugin-vue-jsx";
44
import vueDevTools from "vite-plugin-vue-devtools";
5+
import { resolve } from "path";
6+
import fs from "fs";
57

68
// https://vite.dev/config/
79
export default defineConfig({
810
base: "/",
9-
plugins: [vue(), vueJsx(), vueDevTools()],
11+
plugins: [
12+
vue(),
13+
vueJsx(),
14+
vueDevTools(),
15+
{
16+
name: "copy-htaccess",
17+
closeBundle() {
18+
// Path to your .htaccess file
19+
const htaccessPath = resolve(__dirname, ".htaccess");
20+
// Destination path in dist directory
21+
const distHtaccessPath = resolve(__dirname, "dist", ".htaccess");
22+
23+
// Copy the .htaccess file to the dist directory
24+
if (fs.existsSync(htaccessPath)) {
25+
fs.copyFileSync(htaccessPath, distHtaccessPath);
26+
console.log(".htaccess file copied to dist directory");
27+
} else {
28+
console.warn(".htaccess file not found at project root");
29+
}
30+
},
31+
},
32+
],
1033
assetsInclude: ["**/*.md"],
1134
define: {
1235
"process.env": {},

0 commit comments

Comments
 (0)