deploy.yml: update SSH configuration to use dynamic port from secrets
This commit is contained in:
parent
9a8100432f
commit
4e29d410aa
6
.github/workflows/deploy.yml
vendored
6
.github/workflows/deploy.yml
vendored
@ -39,7 +39,7 @@ 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: Copy docker-compose.yml to VPS
|
||||
uses: appleboy/scp-action@master
|
||||
@ -47,13 +47,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 }}/portfolio/'
|
||||
|
||||
- name: 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 }}/portfolio && \
|
||||
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} && \
|
||||
docker compose pull && \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user