add actions
This commit is contained in:
parent
84491ad413
commit
96b9c50dd0
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
@ -16,7 +16,7 @@ export default defineConfig([
|
||||
reactRefresh.configs.vite,
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2024,
|
||||
ecmaVersion: 2025,
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
|
||||
12
index.html
12
index.html
@ -10,6 +10,18 @@
|
||||
<title>Pumpkin Market</title>
|
||||
</head>
|
||||
<body>
|
||||
<script
|
||||
async
|
||||
src="https://www.googletagmanager.com/gtag/js?id=G-QK7NXQQ2ZP"
|
||||
></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag("js", new Date());
|
||||
gtag("config", "G-QK7NXQQ2ZP");
|
||||
</script>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
|
||||
@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import api from '../api';
|
||||
|
||||
const API_URL = 'http://localhost:5000';
|
||||
const ASSETS_URL = import.meta.env.VITE_ASSETS_BASE_URL || 'https://assets.pumpkinmc.org/icons';
|
||||
|
||||
const Home = () => {
|
||||
const { t, i18n } = useTranslation();
|
||||
@ -243,17 +243,24 @@ const Home = () => {
|
||||
const priceInfo = getEffectivePrice(plugin);
|
||||
const isSale = plugin.type === 'paid' && priceInfo.isSale;
|
||||
|
||||
const imageUrl = plugin.preview_path;
|
||||
console.log(imageUrl);
|
||||
|
||||
return (
|
||||
<Link to={`/plugin/${plugin.id}`} key={plugin.id} className="plugin-card-link">
|
||||
<div className="plugin-card-v2">
|
||||
|
||||
{/* Preview image */}
|
||||
<div className="pcv2-preview">
|
||||
{plugin.preview_path ? (
|
||||
{imageUrl ? (
|
||||
<img
|
||||
className="pcv2-preview-img"
|
||||
src={plugin.preview_path}
|
||||
src={imageUrl}
|
||||
alt={plugin.name}
|
||||
onError={(e) => {
|
||||
// Fallback if image 404s
|
||||
(e.target as HTMLImageElement).style.display = 'none';
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<div
|
||||
|
||||
36
workflows/deploy-backend.yml
Normal file
36
workflows/deploy-backend.yml
Normal file
@ -0,0 +1,36 @@
|
||||
name: Deploy React Frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build Project
|
||||
run: npm run build
|
||||
|
||||
- name: Deploy Static Files to VPS
|
||||
uses: appleboy/scp-action@v1.0.0
|
||||
with:
|
||||
host: ${{ secrets.VPS_IP }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: ${{ secrets.VPS_PORT }}
|
||||
source: "dist/*"
|
||||
target: "/var/www/market/frontend/"
|
||||
strip_components: 1
|
||||
overwrite: true
|
||||
Loading…
Reference in New Issue
Block a user