fix(deploy): update SSH configuration to use dynamic port from secrets for improved flexibility
This commit is contained in:
parent
214414cb06
commit
9b464c6fac
10
.github/workflows/deploy.yml
vendored
10
.github/workflows/deploy.yml
vendored
@ -56,11 +56,11 @@ jobs:
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
|
||||
ssh-keyscan -p ${{ secrets.VPS_PORT }} -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Ensure zapishis directory exists on VPS
|
||||
run: |
|
||||
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "mkdir -p /home/${{ secrets.VPS_USER }}/zapishis"
|
||||
ssh -i ~/.ssh/id_rsa -p ${{ secrets.VPS_PORT }} -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "mkdir -p /home/${{ secrets.VPS_USER }}/zapishis"
|
||||
|
||||
- name: Create real .env file for production
|
||||
run: |
|
||||
@ -78,7 +78,7 @@ jobs:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
key: ${{ secrets.VPS_SSH_KEY }}
|
||||
port: 22
|
||||
port: ${{ secrets.VPS_PORT }}
|
||||
source: '.env'
|
||||
target: '/home/${{ secrets.VPS_USER }}/zapishis/'
|
||||
|
||||
@ -88,13 +88,13 @@ jobs:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
key: ${{ secrets.VPS_SSH_KEY }}
|
||||
port: 22
|
||||
port: ${{ secrets.VPS_PORT }}
|
||||
source: 'docker-compose.yml'
|
||||
target: '/home/${{ secrets.VPS_USER }}/zapishis/'
|
||||
|
||||
- name: Login and deploy on VPS
|
||||
run: |
|
||||
ssh ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "
|
||||
ssh -i ~/.ssh/id_rsa -p ${{ secrets.VPS_PORT }} -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "
|
||||
cd /home/${{ secrets.VPS_USER }}/zapishis && \
|
||||
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} && \
|
||||
docker compose pull && \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user