ci: deploy via direct file copy, no SSH needed
This commit is contained in:
@@ -40,38 +40,12 @@ jobs:
|
|||||||
NUXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
|
NUXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
|
||||||
NUXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
|
NUXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
|
||||||
|
|
||||||
- name: Install deploy tools
|
- name: Deploy to server
|
||||||
run: apk add --no-cache openssh-client rsync
|
|
||||||
|
|
||||||
- name: Setup SSH with jump host
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
apk add --no-cache docker-cli
|
||||||
echo "${{ secrets.XFLOW_RUNNER_DEPLOY_KEY }}" | tr -d '\r' > ~/.ssh/id_rsa
|
mkdir -p /opt/xflow/.output /opt/xflow/prisma
|
||||||
chmod 600 ~/.ssh/id_rsa
|
cp -r .output/. /opt/xflow/.output/
|
||||||
ls -la ~/.ssh/id_rsa
|
cp -r prisma/. /opt/xflow/prisma/
|
||||||
head -1 ~/.ssh/id_rsa
|
cp package.json /opt/xflow/package.json
|
||||||
cat > ~/.ssh/config << EOF
|
docker compose -f /opt/xflow/docker-compose.yml up -d --force-recreate xflow
|
||||||
Host jumphost
|
echo "✅ XFlow deployed at $(date)"
|
||||||
HostName ${{ secrets.JUMP_HOST }}
|
|
||||||
User ${{ secrets.JUMP_USER }}
|
|
||||||
IdentityFile ~/.ssh/id_rsa
|
|
||||||
StrictHostKeyChecking no
|
|
||||||
UserKnownHostsFile /dev/null
|
|
||||||
Host target
|
|
||||||
HostName ${{ secrets.DEPLOY_HOST }}
|
|
||||||
User ${{ secrets.DEPLOY_USER }}
|
|
||||||
ProxyJump jumphost
|
|
||||||
IdentityFile ~/.ssh/id_rsa
|
|
||||||
StrictHostKeyChecking no
|
|
||||||
UserKnownHostsFile /dev/null
|
|
||||||
EOF
|
|
||||||
|
|
||||||
- name: Copy .output to server
|
|
||||||
run: |
|
|
||||||
rsync -az --delete .output/ target:/opt/xflow/.output/
|
|
||||||
rsync -az prisma/ target:/opt/xflow/prisma/
|
|
||||||
rsync -az package.json target:/opt/xflow/package.json
|
|
||||||
|
|
||||||
- name: Run migrations & restart container
|
|
||||||
run: |
|
|
||||||
ssh target 'cd /opt/xflow && docker compose up -d --force-recreate xflow && echo "✅ XFlow deployed"'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user