removed ssh, back to ftp
This commit is contained in:
+15
-30
@@ -16,41 +16,26 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "22" # match the version your project targets
|
node-version: "22"
|
||||||
|
|
||||||
- name: Build (verify it compiles)
|
- name: Verify build (locally)
|
||||||
run: |
|
run: |
|
||||||
npm ci --no-audit --no-fund
|
npm ci --no-audit --no-fund
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Setup SSH client
|
- name: Stage source for upload
|
||||||
run: |
|
run: |
|
||||||
which rsync ssh || (apt-get update && apt-get install -y rsync openssh-client)
|
mkdir .deploy-stage
|
||||||
mkdir -p ~/.ssh
|
tar --exclude=.git --exclude=node_modules --exclude=.next \
|
||||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
|
--exclude=.deploy-stage -cf - . | (cd .deploy-stage && tar xf -)
|
||||||
chmod 600 ~/.ssh/deploy_key
|
|
||||||
ssh-keyscan -H 82.165.141.176 >> ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: Test SSH
|
- name: Upload source to server (FTP)
|
||||||
run: |
|
uses: SamKirkland/FTP-Deploy-Action@4.2.0
|
||||||
ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@82.165.141.176 'whoami && ls /dev/karlderheinz.tv'
|
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
|
# TODO: trigger the server-side build + restart (next conversation)
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user