removed ssh, back to ftp
This commit is contained in:
+15
-30
@@ -16,41 +16,26 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22" # match the version your project targets
|
||||
node-version: "22"
|
||||
|
||||
- name: Build (verify it compiles)
|
||||
- name: Verify build (locally)
|
||||
run: |
|
||||
npm ci --no-audit --no-fund
|
||||
npm run build
|
||||
|
||||
- name: Setup SSH client
|
||||
- name: Stage source for upload
|
||||
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
|
||||
mkdir .deploy-stage
|
||||
tar --exclude=.git --exclude=node_modules --exclude=.next \
|
||||
--exclude=.deploy-stage -cf - . | (cd .deploy-stage && tar xf -)
|
||||
|
||||
- name: Test SSH
|
||||
run: |
|
||||
ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@82.165.141.176 'whoami && ls /dev/karlderheinz.tv'
|
||||
- name: Upload source to server (FTP)
|
||||
uses: SamKirkland/FTP-Deploy-Action@4.2.0
|
||||
with:
|
||||
server: 82.165.141.176
|
||||
username: ${{ secrets.FTP_USER }}
|
||||
password: ${{ secrets.FTP_PASS }}
|
||||
local-dir: .deploy-stage/
|
||||
remote-dir: /dev/karlderheinz.tv/
|
||||
|
||||
- name: Copy source to server
|
||||
run: |
|
||||
rsync -avz --delete \
|
||||
-e "ssh -i $HOME/.ssh/deploy_key" \
|
||||
--exclude node_modules --exclude .next --exclude .git \
|
||||
./ "${{ secrets.DEPLOY_USER }}@82.165.141.176":/dev/karlderheinz.tv/
|
||||
|
||||
- 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
|
||||
fi
|
||||
systemctl restart <your-plesk-unit> # or: monit restart <name>
|
||||
EOF
|
||||
# TODO: trigger the server-side build + restart (next conversation)
|
||||
|
||||
Reference in New Issue
Block a user