still trying to get build working
This commit is contained in:
+31
-14
@@ -7,7 +7,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-copy:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -16,19 +16,36 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20" # match the version your project targets
|
||||
node-version: "20"
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm
|
||||
- name: Build (verify it compiles)
|
||||
run: |
|
||||
npm ci --no-audit --no-fund
|
||||
npm run build
|
||||
|
||||
- name: Build
|
||||
run: pnpm install && pnpm run build
|
||||
- name: Setup SSH client
|
||||
run: |
|
||||
which rsync ssh || (apt-get update && apt-get install -y rsync openssh-client)
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
|
||||
chmod 600 ~/.ssh/deploy_key
|
||||
ssh-keyscan -H 82.165.141.176 >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Copy build output to FTP server
|
||||
uses: SamKirkland/FTP-Deploy-Action@4.2.0
|
||||
with:
|
||||
server: 82.165.141.176 # LAN IP of the box running your FTP server
|
||||
username: ${{ secrets.FTP_USER }}
|
||||
password: ${{ secrets.FTP_PASS }}
|
||||
local-dir: dist/
|
||||
remote-dir: /dev.karlderheinz.tv/
|
||||
- name: Copy source to server
|
||||
run: |
|
||||
rsync -avz --delete \
|
||||
--exclude node_modules --exclude .next --exclude out --exclude .git \
|
||||
./ "${{ secrets.DEPLOY_USER }}@82.165.141.176":/var/www/vhosts/dev.karlderheinz.tv/nodejs/<app-name>/
|
||||
|
||||
- name: Install, build and restart on server
|
||||
run: |
|
||||
ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@82.165.141.176 <<'EOF'
|
||||
set -e
|
||||
cd /dev.karlderheinz.tv
|
||||
npm ci --no-audit --no-fund
|
||||
npm run build
|
||||
if [ -d public ]; then
|
||||
cp -r public .next/standalone/public # standalone needs your static assets copied in
|
||||
fi
|
||||
systemctl restart <your-plesk-unit> # or: monit restart <name>
|
||||
EOF
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
// next.config.ts
|
||||
const nextConfig: NextConfig = {
|
||||
/* config options here */
|
||||
output: "standalone",
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Generated
+5741
File diff suppressed because it is too large
Load Diff
Generated
-3839
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user